Rhino.Command/ variables input?

HI all,

Can we use variables in Rhino.command ?

I tried with the code below ( not sure about my syntax) the ID is returned as unknow command.

How can i do ? possible ?

Thanks.

Call Split() Sub Split()
arrObject = Rhino.GetObjects("Select object")

If IsArray(arrObject) Then
	For Each strObject In arrobject
		strCutter = Rhino.GetObject("Select cutter")
		Rhino.Command "_Split " & strObject & "_Enter " & strCutter & "_Enter "

		'			Rhino.Print "strObject ID :" & strObject
		'			Rhino.Print "strCutter ID :" & strCutter
		
	Next
	
End If
End Sub

Yes, but command _Split need selected objetcs, you still have to put a command _SelID between…

Option Explicit
’Script written by
'Script copyrighted by
'Script version Freitag, 6. Mai 2016 10:27:27

Call Split()

Sub Split()

Dim arrObjects, strObject, strCutter

arrObjects = Rhino.GetObjects("Select objects", 0, True, True, False)

If IsArray(arrObjects) Then
    
    strCutter = Rhino.GetObject("Select cutter", 0, True, False)
    
    
    
    For Each strObject In arrobjects
        
        Rhino.Command "_Split _SelID " & strObject & " _Enter _SelID " & strCutter & " _Enter" 
        '            Rhino.Print "strObject ID :" & strObject
        '            Rhino.Print "strCutter ID :" & strCutter
        
        Rhino.UnselectAllObjects
    
    Next

End If

End Sub

…

1 Like

Hello eddi,

Ok , Thanks for reply !