rs.ObjectsByType() again not obeying State param

In Rhino 7 rhinoscriptsyntax the ObjectsByType(geometry_type, select, state) function is not returning a list of ids properly constrained by the State parameter. A similar bug was reported in R5 and another (slightly different) in R6. Now here we are in R7 with another different behaviour and it’s still not right.

Here are two surfaces with 4 and 6 control points on respectively. Running ObjectsByType with the geometry type set to grip returns the correct results for each of the four principal states:

Now turn off the red layer. State 0 (All objects) is correct, State 1 (Normal objects) is correct, State 4 (Hidden objects) is wrong (should show 6 grips):

Turn the red layer on again and hide (Ctrl-H) the black object. Now State 1 is incorrect (should show 6 grips) as well as State 4 (should show 4 grips):

ObjectsByTypeBugDemoObjects.3dm (35.7 KB)
ObjectsByTypeBugDemoCode.py (349 Bytes)

Regards
Jeremy

Checking it, thanks.

Yeah, so hidden is not the same as on an off layer… but it should be:
“When true, hidden objects or objects on hidden layers are returned.”

RH-71055 ObjectsByType failure for hidden
thanks,

-Pascal

Hi @pascal,

Thanks for following up. It looks like RhinoCommon has similar problems. I briefly tried using sc.doc.Objects.GetObjectList(settings) instead, with settings = Rhino.DocObjects.ObjectEnumeratorSettings(), and the state boolean attributes don’t seem to work any better.

Regards
Jeremy

P.S. Back in Rhinoscriptsyntax, as a workaround for anyone who needs it, IsObjectHidden(object_id) works correctly so can be used to cherry pick the hidden objects from the ObjectsByType list.