Object attributes - "By Parent"

I am trying to understand this a little bit better because I have some scripts that select or change objects by their attributes and generally I have excluded the ‘by parent’ option because it’s too complicated to figure out. So, from the Rhino Help:

By Parent

This option is only useful for objects in blocks. Think of a block instance as a container that contains objects (block members). A block instance is the parent of its block members. A block instance has its own properties. If By Parent is selected in the properties of a block member, the properties will be controlled by the block instance.

I don’t really get this. A block instance is the child of a block definition which contains the block object’s geometric definitions plus their attributes. So the block instance is not really a ‘parent’ of the members in it. Well, maybe it could be construed that way, it is a representation of a collection of objects so I guess it could be considered to be the collection’s ‘guardian’. But the real parent remains the block definition.

Anyway, in practical tests, it appears that with simple, non-nested blocks, it only makes a difference if the attribute definition (color, linetype, etc.) of any of the original objects making up the block definition have ‘by parent’ applied. Applying ‘by parent’ to a block instance does not change anything - except, I guess, in the case of nested blocks (ugh). Do I have that right?

And, of course for normal non-block objects, setting any attribute to ‘by parent’ seems to do nothing at all, looks like the attribute remains the same as ‘by layer’ Is that right?

Hi,
I recently had to work on a jewerly web application which had to do some tasks based on MatrixGold output, which had some of this “by parent stuff” so I dwelved into it.
You’re mostly correct. The “By Parent” setting is useful for objects within blocks, and it allows the properties of those objects to be controlled by the block instance that contains them, hierarcy wise Layers>Blocks
I think the feature name is very missleading I had your same doubts.

The block instance is not the “parent” of the objects within it in the traditional sense. Instead it’s more accurate to say that the block instance is a “container” for the objects within it.

Hope this clarifies the concept a bit, which I totally agree is very missleading.
Farouk

This is correct. Any top level object (object not inside of a block) will default to ByLayer if an attribute is set to ByParent. Instance objects can be top level objects as well.

An instance object consists of attributes, a transform, and a reference to an instance definition. Instance definitions are lists of Rhino Objects (curves, breps, points, …). Instance objects can also be in this list which is how you end up with nested blocks. When an attribute is set to ByParent and an object is in a block, the attribute is retrieved from the “parent” instance object. If that parent instance object is also inside of a block and its attribute is also set to ByParent, then we keep looking up the chain to retrieve then attribute.

2 Likes

This is a very helpful explanation of how blocks are structured–thank you.