RhinoScript: getting AllObjects, including these in Block Definitions


#1

Hi All,

I am trying to get the list of ALL objects in the current file, including the ones that make up the block definitions.
Rhino.AllObjects does not return these.
If there a way to access them without going through each block definition and querying for its objects list?

I am trying to get all objects ByLayer, but including these inside Blocks.
@Dale, would it make sense to add yet another switch to Rhino.ObjectsBy… functions to include these inside block definitions?
Or also a switch to Rhino.AllObjects to include these in the result ?

Thanks,

–jarek


(Dale Fugier) #2

Hi @Jarek,

This is true.

No, there is not.

Since nobody has ever asked for this, I’ll say no, probably not. Sounds like you’re doing something specialized, and it isn’t difficult to get the block definition objects. But you’re welcome to push back. Feel free to make a YouTrack item if you want.

– Dale


#3

Thanks Dale, I created YT item as a form of push back ; ) I would assume Python’s RhinoScript version could also use that enhancement.

The thing is, Rhino 6 introduced a lot of new possibilities to take advantage of I while exploring these inevitably will find a small (or big) tweaks to make scripting keep up this them.
In this particular case I am not doing anything super fancy, but trying to set custom object display modes per-Layer.
One limitation is accessing these inside blocks, the other that the “AddObjectDisplayMode” method can take only 1 object. But I remember you mentioned it’s not easy to make multiple objects at once work.
Anyway, thanks for clarifications.

–jarek