Plugins - Use custom variable to put DC components in tags

Hello,

I design small woodframe houses and I make all my blueprints with Sketchup and Layout.
I made a big Dynamic Component that make all my structures.
Each blueprint is made from a specific Tag.

The structure looks something like that :

House
→Lower block
—→Chassis
—→Deck
—→Floor
→Middle block
—→Wall
— —→Woodframe
— —→Cladding
— —→Openings
→Top block
—→Roof framework

For all the opening structures, I made a single DC that uses parent! variables to get the wall caracteristics (thickness etc.). When I duplicate those to each wall, I have to enter in each copy to set the tags, and it is quite tedious.

Here is the question :
I’d like to give my DC components a custom variable and make a plugins that set it’s tag to that variable.
I’m new to ruby and I can’t get my DC custom variable, is there a way to do that ?

Thanks !

i have a bunch of individual DC which i have pre-applied tags to so they match my overall template. framing, foundation, gwb, etc to structure tags, electric bits to electrical tags, plumbing, hvac, etc. for as-is models i apply demolition tags when needed. this way when i merge the different models all the tags align and i can create the sections/views needed and just update individual models and components as needed. this avoid a lot of the tagging work upfront and the master model file has them all consistently added. given the DC don’t always retain the tags if not embedded deeply, i find many simpler DC easier to maintain than complex ones when making duplicates etc.

Copy objects are tagged by the current active Tag, usually ‘Untagged’.
One can bypass this by using the old ‘Layer-way’ and tag the original objects faces and edges directly…

Thanks for your tips.
The point of doing this is repeatability as I’m doing always the same big block but with some small variations.
The tag in my custom variable inherit his name from his parent (for exemple =parent!tag&“_windows” which will give the tag “wall_A_windows”).
That kind of plugin would help my prototyping a lot quicker.

I’ve found a script that gives all the keys and values of my DCs, but I can’t manage to get only the custom “tag” variable.