Similar Dynamic Components losing reference to parent

I have successfully created a series of similar dynamic door components, but I have noticed that the child’s link to the parent is confused when I insert both into the same model. I have made sure the Definition Name for both the parent and the children are unique in both dynamic components. I do not have any problem with either when I insert into a new model, but whenever I insert into an existing model where they are both and others are present I get an error in the Component Attributes Window.

The attached picture shows a 2 panel door and frame dynamic component (right window is in a fresh .skp), (left window is a file with other components, some dynamic).

How do I lock the children to the parent of each unique dynamic component?

D_2PanelDoorAndFrame_DF#2.skp (542.9 KB)

Try not using exact names.

Use =Parent!attribute in formulae.

An issue with definition names is that if another gets loaded with the same name as one already present in the “In Model” Components collection, then SketchUp automatically differences the name of the newly loaded definition copy, appending "#<integer>" to the name.

P.S. - You can also chain the parent! references … ie: =Parent!Parent!LenX

2 Likes

FYI

The DC “_name” attribute (what you set by double clicking in the Component Attributes dialog,) is just a text attribute used by the DC code. The real name property for the component definition is a separate thing set in the Component Inspector panel. (You should set this property before saving out the component’s .skp file. You’ll want these to be unique and represent the differences in the components.)

Obviously each different DC component needs a unique .skp filename. But filenames are not displayed in the Component inspector browser tab. It’s the Component name property that is displayed.

When you first start to create a DC from a “dumb” component, the name properties of the component and it’s nested objects and copied into “_name” attributes. But from then on they can be edited and diverge.

So it is the DC “_name” attribute that is used to identify DCs in formulae.

If working on DCs a lot, I suggest you get Aerilius’ Attribute Inspector extension from the EW.

1 Like

Hi Dan,

I got excited when I saw this post about chaining parent! references!
But, when I tried it it didn’t work. Am i missing something?

I don’t know. You’d need to post a DC file so one of the DC gurus like Phil can take a look.

But I would think that a grandchild component or group could refer to the toplevel DC as …
=parent!parent!

I don’t think it matters if it uses "parent!" or "Parent!".

Here is a simple sample model to demonstrate the ability to chain parent references.
In the sample we have a root component, a child component and a grandchild component.
Each component has an attribute called “test”. “root!test = 1”, “child!test = 2” and as you can see, “grandchild!test = parent!parent!test” would not parse.

Did I misunderstand or should this have worked?

Caining_Parent.skp (203.2 KB) I am using SketchUp Pro 2020

Thanks for your suggestion.

I am looking at this Caining_Parent.skp and I do not see anything in the ‘Component Options’ view and no way to enter any different dimensions. In the ‘Component Attributes’ View, when I go down to the Grandchild level, I see this error.

  1. I spell “Chaining” with an h. :wink:

  2. The root DC component has no attributes.

  3. Within it, the “TestRoot” component is really a child component.

  4. I changed the "GrandChild!test" attribute to “Users can see this” and opened the Component Options dialog, and it actually does display, but displays it’s immediate parent’s "test" value, which is 2.
    We want to actually see 1.


I tried this:

I added a "root" attribute in "TestChild" containing =parent!test ,

Then changed "TextGrandChild!test to be =parent!root and correctly got 1 displayed.

So it’s sort of a chain.

EDIT: We do get the same value if
"TestChild!test" is =parent!test and "TextGrandChild!test is =parent!test.


I really thought that the parent! could be chained. Let’s ask Phil … @pcmoor ?

Sorry about the misspelling! :wink:

1 Like

Check this post:

To my knowledge, DC’s have a scope of three levels:
One up, one down and equal.
All within the nested DC.

A model (level 0) can have attributes as well, though not visible in the UI.
Level 1 Components are siblings but their children (level 2) don’t see each other.
They have to ask their parents :smiley:

I appreciate the discussion about different levels of DC’s, but can we get back to the original question of 'How do I lock the children’s attributes to the parent?

Thank you,

Yes I too, hence the like, but I guess the “proof is in the pudding”, I do hope that the powers that be, extend / improve the DC abilities rather than just pursue “the cloud”, in a coding perspective, chaining would be a reasonable assumption.

parent! is the solution to your problem provided the syntax of the formulas remain the same, otherwise you would have make the different one unique to stop the overwrite or update when placed with same

So the only way is to pass them down from level to level, as shown above. bummer.

I tried to find this in the DC User Guide. Do you have a link ?

Not really, there is a tip about referencing:

If you only use this method, you are kind of stuck in the context of the component that’s being edited (you only see two levels).

Yes @DanRathbun it is a bummer. It brings us back to question, why sketchup gurus don’t pay attention to improve functionality of DC… (I don’t want to open the discussion again as it’s already discussed)
Even parent!parent!test as you thought would do great improvement.