I just discovered that component instances can be glued to groups.
The chair component in this image is set to glue to horizontal. The box is a group.
Each instance was added and glued “to face in group” at a point in time when there was a horizontal face in the group at each instance location. The instances are NOT in the group.
Subsequent edits of the group deleted or moved the faces that each chair was originally glued to.
Yet each chair is still glued to the group: If I move the group, the chairs move.
Each chair insertion point is actually glued at an xyz coordinate relative to the group’s origin.
If the group is scaled the chair positions move but the chairs themselves are not scaled.
The only downside is that component instances glued to groups cannot cut openings.
This behavior is actually quite useful. Is it documented anywhere?
(It would also be nice if groups could be glued to other groups.)
Yes it is a user feature, but it’s not covered in the help pages.
and while the API has a method
Face.get_glued_instances
it doesn’t have
Group.get_glued_instances
ComponentInstance.glued_to= refers only to faces:
"The glued_to= method glues this instance to a face. "
Yet
ComponentInstance.glued_to refers to “entity”
"The glued_to method is used to retrieve the entity that this instance is glued to. "
and returns a group entity if component instance is glued to a group whether of not the original face in the group has been deleted.
The issue with the API is that if I take advantage of this, can I be sure they won’t remove this undocumented feature at some point?
I’m reviving this topic because the issue just came up in an extension I’m developing.
Simple explanation is: user selects an array of component instances and/or groups.
Code does a series of complex array transforms to orient the array to the XY plane.
Once I’m there I do various calculations and transform the entities individually.
Lastly I inverse the original array transform to get back to the original orientation.
Problem comes when the array may include instances glued to other members of the array: These “gluers” get transformed twice: once because they follow their gluee, then when their own turn arrives.
I have 2 options:
don’t include the gluers in the array transforms, which I could do.
break the glue at the outset and reglue at the end.
For various reasons I’d prefer to do the latter.
I can break glue with “instance.glued_to = nil”, but the API doesn’t seem to have a way to reglue an instance to a group or another component instance (even though users can.)