Group.to_component


#1

When creating a component from a group it appears that only the group entities are copied into the component definition.
It strikes me as logical that attributes should also be copied otherwise the component definition is incomplete. This might be an one for the Trimble todo list


#2

With a group its attributes are attached to the group NOT the group’s definition.
With a component-instance attributes are attached to it, not its definition.
A definition can have its own attributes attached, quite separate from the instance itself.
With DC attributes… there are a few DC attributes with the instance itself, but the hardworking DC attributes are attached to the instance.definition.

When you convert a group into a component using group.to_component then the resulting component instance will get all of the attributes that the group had.
But the instance.definition will not get those attributes.
However, if the group.definition has been assigned attributes, then the new component definition will also take those attributes.

It is easy to confuse groups and instances, and their definitions.
A group is really a special kind of component instance - it still has a definition, but it’s not listed in the Components Browser, and although multiple copies of a group can exist editing one of them automatically makes it unique - separated from its siblings with its own definition.
Attributes of many kinds can be added to instances and groups, and also [quite separately] their definitions - indeed almost any SketchUp ‘entity’ can have an attribute - including the model itself…