Dynamic Component limitation or bug?
-
I am hoping someone can explain the behaviour of the attached dynamic component.
This simple example starts with a set of nested cubes. Note that the location and size (x,x,y,LENX,LENY,LENZ) of the cubes have been constrained with "=".
One of the subcomponent cubes (a component instance) is selected and a material attribute is changed to Blue.
A second subcomponent is selected and changed to material Red.
A third subcomponent is selected and changed to material Yellow. Note how the cube moves to a location near the origin. This location happens to be the absolute x,y,x coordinates of the cube. The cube appears to have forgotten the location of the parent component.
Selecting and refreshing the set of 4 cubes sets the material color back to the green default as expected but does not correctly reposition the set.
Refreshing the entire dynamic component (Cube Group) clears everything and resets the position.
Note that it is possible to change the particular cube but not more than a couple before the same issue repeats. This behaviour is occuring with other models built completely differently.
Does anyone understand what is going on? Your help is much appreciated.
-
A little update. The behavior I describe below seems to be an undocumented limitation of dynamic components. My work around is to place all the attributes at the top layer (cascading them down step by step as needed) and only set the component options at the top level. When sub-components "fly-apart" a component refresh normally does the job and does not lose the attributes.
I am still wondering if anyone else has noticed this limitation?
-
I have not seen that before, no.
Chris
-
It is now many years, later, the current version is SketchUp 2017, yet I'm still seeing the exact same issue with a complex dynamic component.
The basic problem is that there are no global attributes in Dynamic Components: only local attributes that can be seen one level up and one level down in the hierarchy. I thought that this severe limitation could be bypassed by creating some lower level attributes the refer up to "parent!" attributes at a higher level, and others at higher levels that refer down to "child" attributes at lower levels, but it does not work. SketchUp does not traverse the entire hierarchy in both directions with each refresh or "redraw": it only seems to go down each branch once, so lower level attributes cannot be passed up one branch and down another.
Thus, the ONLY option is what the original poster already discovered, years ago: calculate all attributes at the highest level, and then pass them down each branch. There's no way to reliably pass things back up again, nor to pass things between branches of the hierarchy. It's a great pity, as adding the simple functionality of global attributes would solve the problem entirely, and completely avoid the need to be passing things around between levels!
Hopefully one day the SketchUp developers will figure out how to implement global attributes. Is this product even still being developed? There doesn't appear to have been any changes or updates to it at all, in YEARS! I have seen changes to the version number each year, but precious little in the way of new features, or even bug fixes. Is this a dead product?
In the meantime, your solution is the only way that works.
Advertisement