Set tag of a DC by a selection of a dropdown in the DC?

Just wondering if there is any way to set the tag (layer) the DC sits on as a response to a selected dropdown option?

In the DC alone, No, but if there is an associated ruby, then can update any data. Maybe its something to consider, not a hack of the DC code, but rather a companion. One that should be run before any takeoff or presentation. One that may not only update but simplify any DC and reduce file size. Note: any simplified DC instance can be reinstated with a swap with its definition and current instance data is retained, except the instance name, but can be retained as an attribute if required
Having your own extension kind of protects your family of DCs, they can not complete the task without help from their friendly ruby that you supply

@simjoubert has an amazing plugin that extends dynamic components. SJ_addcfunction. This add new methods, one being =setlayer(layername).
This has been extremely useful and i use it throughout my dc library, however this functionality only works if you have the plugin installed. Theres a bunch of other functions that are really useful also

2 Likes

Hello,
I am glad to read that this is useful for you! :blush:
I have developed a directory of new functions to improve my workflow and for games.
These new functions are grouped in a plugin that I named SJ Add Dc Functions.
It is intended for my personal use and I share it for those who want it on my site.

:warning:
I warn however, If you share your components with other users, they must also install this plugin.
For some this plugin is illegal, because they believe that I am modifying a licensed code.
Even if this plugin had a bright public future, I prefer not to advertise it and warn users.

For those who want to see the demo, it is here on my personal site https://www.sketchup.simjoubert.com/

1 Like

That is probably because made the functions available in the DC attribute dialog, the key is to extend the functionality via a companion script that then adds an attribute with data, you are not extending, altering, or excessing the original code, but going through document methods in their ruby API

But, just maybe with enough pressure, from any DC users, they may revamp DCs, make them as part of the professional code. I really feel LCs need 5 more years to become professionally viable, unless they can throw millions at it, dollars, manpower, and or course user needs, not their own

1 Like

It’s always a shame to have to invent a new wheel when the first one exists!
Of course, you can recreate an observer for each component, but on large projects with many sub-elements nested on several sublevels to keep the evolution of each part possible, this risks severely slowing down SketchUp.

In the next version to be released, I have given pride of place to CSVs in reading/searching. Replacing definitions on the fly…

One of the problems that bothers me in DCs is the obligation to raise all errors, even in the case of a false condition. (div error by zero)
I come to want to return to observers that test the change of values ​​passed as a parameter. This requires storing the old value in another dictionary and testing. If the value has changed, a Triger is triggered!

For DCs there is still a long way to go. The big black spot is the fact that this is in line with the incompressible latencies. Another political imperative from Trimble management! A guy who has never opened Sketchup or been forced to work on it. And there are still some annoying points to fill in to reach level 1.0
If the target is Sketchup (layer management, preserved axes of groups that undergo transformations, generation of exploitable attributes, API to access inputs, …

2 Likes

As always Phil! BIG thanks, I was just looking for a way to push a panel noted as a “Stacked Upper” to its own layer! But that’s cool, as we currently select from the material assigned to the panel, again this is similar to the issue I’m having with Cutlist, and another reason why I don’t want to ditch this painting option. It allows us to quickly select different panel parts in the model!

It’s a shame everything with SketchUp takes years, particularly when you look at the progression of other software. The small team behind D5 render for example, do several major upgrades a year!