algorithmic modeling for Rhino
Hi guys,
I am trying to rotate a line within a loop but found out the rotate command asks for sinus and cosinus instead of an angle (please see below). Would you know why?
Also I noticed that if I skip the second argument within the method it still works, how would one know if an argument is optional ?
Cheers,
Arthur
Tags:
Hi Arthur,
there are 5 methods with the same name ("1 of 5"). They are called overloads.
If you click on the yellow label you'll see the rest of them. Also if you push Ctrl+Shift+Space the label should appear, and you can use arrows up and down to scroll.
- Giulio
Got it i think :)
Private Sub RunScript(ByVal x As Point3d, ByVal y As Point3d, ByVal z As Double, ByVal u As Integer, ByRef A As Object, ByRef B As Object)
'declare line
Dim ln As New Line(x, y)
'Declare the list
Dim lines As New List(Of Line)(u - 1)
' Add End point
Dim endpt As New list(Of Point3d)(u - 1)
'loop
Dim i As Int16
For i = 1 To u - 1
'rotate line
ln.Transform(transform.Rotation(z * i, vector3d.ZAxis, ln.from))
'add line
lines.add(ln)
'add endpt
endpt.add(ln.To)
Next
A = lines
B = endpt
Nice!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by