I’m trying to use the SelBoundary command in a macro and/or script, but I can’t figure out how to select the boundary curve just once… When I call the command from python, it stops to wait for an input and won’t let me use rs.SelectObject to continue. That wouldn’t be ideal if I want to do the script in batches. I ran into this problem before too when I was trying to use Squish in python. What am I missing, or is there another way to go about this?
IIRC, you will need to name the boundary curve (can do that in the script) then select it by name in the command string using SelName… Or maybe you can just use SelID with the object id gotten from GetObject(). Edit - yes, SelID works.
import rhinoscriptsyntax as rs
msg="Select closed curve to use as a selection boundary"
obj_id=rs.GetObject(msg,4,preselect=True)
if obj_id:
comm_str="_SelBoundary _SelectionMode=_Window _Precise=_Yes _SelID {}"
rs.Command(comm_str.format(obj_id),False)