Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5892

LastCreatedObjects RhinoScript trouble

$
0
0

@cristina.b wrote:

Hi,

I am trying to generate some curves in a "For" loop, then select them all and add them to a group, but it seems that Rhino.LastCreatedObjects does not work in the same script. I took the example from Help and added a for loop to generate same curves after the circles and yet the 3rd circle is being selected.

Thank you very much!
Cristina

Call Main()
Sub Main()
	Dim arrObjects, strObject, arrCrv(5), i

	Rhino.Command "_-Circle 0,0,0 10"

	Rhino.Command "_-Circle 10,0,0 10"

	Rhino.Command "_-Circle 20,0,0 10"
	
	For i=0 To 2
		arrCrv(i) = Rhino.AddLine(Array(0, i, 0), Array(10, i, 0))
	Next
	
	arrObjects = Rhino.LastCreatedObjects

	If IsArray(arrObjects) Then

		Rhino.SelectObjects arrObjects

	End If 
End Sub

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5892

Trending Articles