Hi, I’m fairly new to scripting and even newer to rhino, so my apologies if this is a stupid question.
I’m trying to store a selection of objects inside the User Data of another object. This works nicely with a single object, as in this example:
import rhinoscriptsyntax as rs # select obj to write to obj = rs.GetObject("select object") # get guid to store in user data objs = rs.GetObject("select objects") # stores second object's guid in first object's user data rs.SetUserText(obj, "object", objs) # just check that the guid was written to user data(the format changes if multiple objects are chosen) print(rs.GetUserText(obj, "object")) # select object to get user data from obj = rs.GetObject("select object") # select object using guid print("point selected") rs.SelectObject(rs.GetUserText(obj, "object"))
but as soon as I try to get it to work for multiple objects, this code stops working. Is it possible to store a list of Guids as User Data string and select the corresponding objects afterwards?
Thanks in advance,