Layer controlled by drop down list

Is it possible to change layers of nested geometry in a dynamic component by a function?

I would like to be able to change nested geometry in a dynamic component by list option instead of going into the component and changing with entity info.

Any help would be great, Thanks.

Not that I know of with any native functions.

What are you looking to use this for? The main purpose I imagine of moving objects to different layers several times is to hide them, but that can be done with the HIDDEN function in DC

quantj is correct, at least from my understanding - no way to directly set the layer through a drop-down menu, though this should be included as one of the options in a dynamic component, IMHO - could be a powerful way to manipulate the model.

As for now, a good work-around would be to create a sub-sub component of the item in question that you want to change the geometry on. Then put that sub-sub component into two ‘container’ components, one on each of the two layers - a sub-component who’s only purpose is to 1) live on a certain layer 2) provide a window to that sub-sub component, and to pass the properties along to it. 3) go hidden/not-hidden based on menu chosen in the main component options dialog. then you’re not adding additional geometry (is that correct? We’re using the sub-sub component, twice, but it’s the same component (not ‘unique’) so only counts against polygons/model size once. If i’m wrong here let me know, oh SU gurus). Then when you write you sub-sub component, make sure you use the =parent!Attribute (Attribute being LenX, X, Y, RotZ, etc) instead of referencing the container component itself. That will allow your sub-sub component to inherit properties from whichever sub-component container it’s parked in, without throwing an error.

Hope this helps!

last thing, in order to pass properties along to the sub-sub component, you need to create a reference variable in the sub-component. For example, if I wanted to change the length of my sub-sub component based on a list in the original main component, i would create the variable ‘subLength’ (or whatever you name it) in the main component, then in the sub-component container create one called subLength and make it =parent!subLength then I could reference it in the sub-sub component. Have to pass it down, at least that’s how I’ve been doing it.

SketchUp gurus, is there a way to create global variables within a component so I don’t need to do so much passing of information down the line?

Hey, I recently found a extension called sketchdata which has an attribute editor - in the free toolbar. This allows a user to change an attribute value for multiple components at once. So, if you create an attribute in all your nested components, say ItemLength and you run the attibute editor on the ‘parent component’, select the nested components option and change the value of ItemLength, all the selected items with this attribute name (including sub components) will change. Pretty quick I’ve found…