RhinoDoc.Objects contents and hidden objects

Hi
I’ve noticed a “strange” behaviour accessing RhinoDoc.Objects list.
Let’s say we have a document with 10 objects, 2 of them are hidden.
The RhinoDoc.Objects.Count property says i have 10 objects (of course) but if i cycle through the list using a “foreach” statement or if i try to select objects using LINQ, the “Objects” list just contains 8 objects!
Is this “normal”?
How can i get the complete list of objects?
Thanks to you all!

Sebastiano

It doesn’t seem to be documented properly, but the default enumerator gives you active objects that can be in normal or locked state. Count gives all objects, including deleted ones.

If you want an enumerator to get all objects you should use GetObjectList and pass in a properly set up ObjectEnumeratorSettings instance.

No! It’s simply not documented! :wink:
Anyway, a weird behaviour, IMHO…
Thanks a lot, Nathan. :slight_smile:

I have logged a bug for this: RH-48132

1 Like