02 March 2010

RH lines counter labels&length 01


Option Explicit

'Script written by Davide del Giudice
'Script copyrighted by Co-de-iT www.co-de-it.com
'Script version Tuesday, 02 March 2010 19:20:27

Call Main()
Sub Main()

Dim arrobjects,arrPoint,arrLength,arrPoint2
Dim strobjects,strDot,strDot2,count
arrobjects=rhino.GetObjects("select curve")

For Each strobjects In arrobjects
count=count+1
arrPoint = Rhino.CurveEndPoint(strObjects)
arrPoint2 = Rhino.CurveStartPoint(strObjects)
arrLength=rhino.CurveLength (strObjects)
strDot=Rhino.AddTextDot (" "& count, arrPoint)
strDot2=Rhino.AddTextDot (" "& round(arrLength,1), arrPoint2)
Call Rhino.ObjectColor(strDot, RGB(count/5,count/10,count+5))
Call Rhino.ObjectColor(strDot2, RGB(count/2,count/10,count+100))
Next

End Sub

3 commenti:

Dídac Hueso said...

Hi Davide!

Fantastic BLOG!! And really very usefull!! It's the first time I come but I promise I'll be back every day!

I'm new into this amazing world and I have some (a lot) doubts... If you don't mind I'll ask you about the script you do...

About today's script... What is the sequence the scipt use to numerate the different curves? The scipt ordente the IDs by the way the user select?...

It's possible to re-numerate the points in the way I wish to create new lists to use in GH? Or is better to re-order the points from into GH?

Thanks.

DAVIDE DEL GIUDICE said...
This comment has been removed by the author.
DAVIDE DEL GIUDICE said...

Hi Didac,

thanks for your comment.
The script takes the order of the IDs by GH and numerates the lines with this order because
GH generates lines from an ordinate sequence of numbers in a list.

About re-numerate it's better to use a new list directly in GH.

Bye,

D