Instance Name ceasing to appear as component top level name?

This is a pretty basic question on something I thought I had full control over. But probably I do misunderstand something here?
TestingInstanceNames.skp (169.5 KB)

The attached Sketchup file contains two very simplistic components, they differ in appearance by having one or two vertical lines, called MyComp1 and MyComp2.
Otherwise, MyComp1 has no attributes added, MyComp2 has one single attribute added (in this case the Description field to the component top container).

MyComp1 has been given the Instance name (via Entity Info) C1_1. MyComp2 has been given the Instance name (via Entity Info) C2_2.

Looking at the Component Attribute dialog, MyComp1’s Instance Name “shines through” to the top level name field (which seems logical to me). This does NOT happen for MyComp2.

Actually, itappears that if any attribute field is added to the component top level, then the Instance name ceases to show up as the component top level name.

The point of this is that whenever I give each component instance its Instance Name (via Entity Info) the given name does not anymore appear as Entity Name when I generate a report. Is this not exactly what it is meant to do??

BTW, I currently use Sketchup 20.0.373. Is this problem related to the version?
Anyone to enlighten me?

This does not happen in my tests.

Basically, the “top level name” is the dynamic attribute "_name" (which is distinct from the optional attribute "name" BTW,) anyway "_name" is automatically set to be the component’s instance name if it is not empty. If it is empty, then "_name" is automatically set to be the definition name.

This happens when the Component attributes dialog is refreshed. So if you’ve added an instance name ("C2_2" to the "MyComp2" instance) refresh it by unselecting the component instance and select it again and the dialog is refreshed and "_name" is updated.

You can update the DC extension independent of SketchUp releases.
SU20 had DC v 1.8.0. DC was updated to v 1.8.1 when SU21 was released.

Also FYI, you can override the "_name" attribute’s automation with a manual setting by double-clicking the text. An edit input box will appear.

After a manual setting the automated setting will cease and you cannot go back to automation. (The DC interface will not let you wipe out the "_name" attribute. You can change it however.)

The only way to reset things is to use a 3rd party attribute inspector and delete the "_name" attribute from both the definition’s and instance’s "dynamic_attributes" dictionaries.


Anyway, this is a good lesson in why the top level DC component name should not be used in formula by child object’s. They should use Parent! instead.

1 Like

Thanks for an extensive answer.
I actually found the remedy by reading through a previous thread

Can only specifically named instance of a component be made to respond to a behavior?

answered by @pcmoor, so I got everything to work properly now. However, your answer gave me even more knowledge, so again thank you for sharing your insight.
And thanks for reminding me to update the DC extension. I did not think about that.

2 Likes