Incrementally rotate a curve using VB.net or C#
listed in answer
ANSWER:
I need to duplicate the line before rotating the next one in the loop otherwise there is no trace of it.
In C#:
private void RunScript(Curve ln, int x, double angle, ref object A)
List lns = new List;
for (int = 0; i<= x; i++)
Curve copy = ln.DuplicateCurve();
copy.Rotate(angle * i, Vector3d.ZAxis, ln.PointAtEnd);
lns.Add(copy);
}
A = lns;
in VB.net:
Private Sub RunScript(By Val ln As Curve, ByVal x As Integer, ByVal angle As Double, By Ref A as Object)
Dim lns As New List(Of Curve) ()
For i As Integer = 0 To x
Dim nl As Curve = ln.DuplicateCurve()
nl.Transform(transform.Rotation(angle*i, vector3D.ZAxis, ln.PointAtEnd))
lns.Add(nl)
Next
A = lns
End Sub
by arthurmani from http://stackoverflow.com/questions/10153584

New Comments