How to pass from component to group without damaging DC formulas

How to pass from component to group without damaging the formulas

If you passing a dynamic component it needs to be in a disposable wrapper with the references in the form parent! rather than a specific name. There is an example using a handle wrapper with video

Global Kitchen Cabinet Handles - SketchUp / Dynamic Components - SketchUp Community

hello once again thanks for answering, I saw the video but I don’t see how to make the change from component to group without damaging the formulas, that is to say, my case is very simple I have a component with formulas inside it, there are 3 components all also with I wish that these three are groups, but when I explode I lose all the information, sorry for my ignorance, thank you

So want to change a component to a group and keep the formula. Generally one changes groups to components as they are more stable.
May I ask why?

copy the geometry and create groups of the same name and nesting structure
then copy and paste each formula, update the names to suit
for dropdowns lists, you can use the Aerilius’ attribute inspector to copy and paste

What happened is that I draw everything with components but when doing the exploded view with the exploded open cut list plugin, I see the 3 pieces that are inside the main component and what I want is that only the main component appears without the 3 pieces and When making them groups it works perfect, but I already have a lot of work in advance and I had not realized this inconvenience that is why I want to be able to go from component to group, thanks

Another quirk that you will need to deal with is that for Dynamic groups, all dynamic attributes are in the instance’s attribute dictionary and none attached to the group definition.

So what do you advise me to draw everything from scratch better, that is, create a group and there draw the components inside it?

No. For each nested component instance that you wish to convert to a nested group …

(1) Create a new group with the component instance inside it. This wraps the component instance inside a new group object.

You might need to draw a temporary edge next to the instance in order for the Make Group command to be available. (Afterward you can enter the group and delete the temporary edge.)

(2) Create a new "dynamic_attributes" dictionary attached to the group instance.

(3) Then copy all the existing attributes from the nested component definition’s "dynamic_attributes" dictionary to the new group instance’s "dynamic_attributes" dictionary.

(4) Then copy and overwrite any attributes from the nested component instance’s "dynamic_attributes" dictionary to the new group instance’s "dynamic_attributes" dictionary.

Lastly, explode the nested component instance that is now inside the new group.

ADDITIONAL NOTE: I was thinking that this was about Ruby API coding. I think there are several topics on converting component instances to groups, and also the copying of attribute dictionaries.
The Ruby API subcategory can be searched for code snippets.

I am doing the whole process but I have a problem and that is that the piece does not keep the dimension, it changes when I update it, you know why this happens

Likely the scale is out of sync, you need to “Scale Definition” of all parts prior to the group being created, otherwise the group will have a factor of 1 whilst the components some unknown 1.2? 5.3? 0.3? factor.
These options are available in the right click context menu
You only have the “Reset Scale” for groups otherwise the fix would be “Scale definition” if it was available.
It might be wise to upload an example, so can see what are the issues