CageEdit for Multiple Objects

Continuing the discussion from Cage edit equivalence command in python:

I can’t seem to get the rs.command CageEdit to work for multiple objects!
For example, I used a similar script but selected multiple objects:

Model = rs.GetObjects("select objects", 16)

#cage edit
strModel = str(Model) + " "
rs.Command("_CageEdit " + "selid " + strModel + "_enter " + "BoundingBox " + "World " + "XPointCount " + "2 " + "YPointCount " + "2 " + "ZPointCount " + "2 " + " _enter " + "Global ")

Please let me know why my script is not working. Thanks!
Would “selid” have an influence on single versus multiple objects selected?


SelID only works on one GUID at a time, your variable “Model” will be a list, so it won’t work that way. If you need to select multiple objects to use in a command-line script there are one of two possibilities:

If the command needs only one object group input, usually you can just pre-select the objects:

Model = rs.GetObjects("select objects", 16, select=True)  #objects are selected

#cage edit
strModel = str(Model) + " "
rs.Command("_CageEdit _BoundingBox _World _XPointCount=2 _YPointCount=2 _ZPointCount=2... etc")

Otherwise, it there is more than one set of objects to be input, you can create groups and select them with SelGroup in the command line string.


1 Like

Thank you so much!