Set user text doesn’t allow selecting multiple objects

Option Explicit
Sub SetUserText()

Dim sObj
sObj = Rhino.GetObjects("Select object to SetUserText",0, True, True)
If isNull(sObj) Then Exit Sub

Rhino.SetUserText sObj, "A", "0"
Rhino.SetUserText sObj, "B", "1"

End Sub

Thanks all

H John - if you get a list of objects you need to iterate the list

Sub Main()

	Dim arrObj
	arrObj = Rhino.GetObjects("Select object to SetUserText", 0, True, True)

	If isNull(arrObj) Then
		Exit Sub
	End If
	Dim arrkeys, i
	arrKeys = array("A", "B", "C")

	For i = 0 To uBound(arrObj)
		Rhino.SetUserText arrObj(i), arrKeys(i), i


End Sub


1 Like

not working
Brep A : A,0 ; B,1
Brep B : A,0 : B,1

Brep A : A,CD ; B,EF
Brep B : A,CD : B,EF

Hello- - sorry, I have no idea what this means. If you want help from me, please explain the problem clearly, and post the code that is not working.


1 Like