i’ve discovered a strange buglet when using below to prompt for a mesh object:
import rhinoscriptsyntax as rs
rh_obj = rs.GetObject("Select a mesh", 32, True, False)
it seems to allow to select (decal) mapping widget objects. It rejects the selection though but imho should not allow to select mapping widgets at all.
If a user wants an explicit selection of a single object type and sets the filter for it, he should not be forced to setup a custom geometry filter to filter for the same object type. Decal widgets seem to be connected to the filter with number 268435456 which stands for Phantom objects, at least i can use rs.GetObject with this number and it allows only to select the decal widget.
Decal widgets deserve a more meaningful depiction and handling in RhinoScriptSyntax. If a user interates through all objects and a decal widget is found, query the Object type like this:
import rhinoscriptsyntax as rs
def DoSomething():
obj_id = rs.GetObject("Select widget", 268435456, True, False)
if obj_id:
print rs.ObjectType(obj_id)
DoSomething()
This prints 0 which stands for “Unknown Object” according to the help.
To repeat what i see, please select the mesh plane and go to Properties > Decals, then click the little icon to “Show Decal Widget”, then run below script:
import rhinoscriptsyntax as rs
def DoSomething():
obj_id = rs.GetObject("Select mesh", 32, False, False)
if not obj_id: return
DoSomething()
rs.GetObject prompts for a mesh, but the decal widget can be selected.