Update DC and preserve attributes

Drag and drop in the forums reply area (when you edit or reply), or use the 7th icon from left:

1 Like

You can ‘double wrap’ your DC by making a new component within. By refering to ‘Parent’ attributes and keeping the Options to choose on the highest level Component, the values will be kept.
This will need some preparation/altering your components etc.

Hello. I believe I did that correctly, but please check:

This is where I develop the component

and this is the exported one using right click save as

Sorry for cutting up my reply, it seems i’m only allowed one attachment per message.

The one you “save as” should have
=current(“lenx”)*2.54 in value box of lenx attribute. The 2.54 is just for inch conversion, not needed for those in the USA
like wise for the other sizes
=current(“leny”)*2.54
=current(“lenz”)*2.54
Then the values will be matched to the one swapped, Do not worry about overwriting these formulas whilst working in the model, so long as the saved component has them

1 Like

Not sure what you mean, because that seems like a circular dependency, and sketchup does complain becuase of that too: 33

This is what I wrote: 11

you are on a mac, try without the quotes, don’t forget the *2.54 to change to cms

Like 90% of the population I am using cms by default :wink:, but your suggestion is introducing a circular reference:

Any ideas why my messages are being marked as spam?..

Hello pcmoor, I may be having a similar issue as the OP. I have two DCs that have a “Left” or “Right” attribute saved to my component library with the direction set to “Right”. If one is set to “Left” in the model and I try to reload it with one from the library the direction flips. So, now “Right” has become “Left” and vice versa. Is there a way to have reloaded components take up the attributes of the one they are replacing?Dynamic Component Saved Scene.skp (316.2 KB)

You’ll need to wrap the components in a Higherlevel wrapper component were you direct all the varables.

and the file:
Dynamic Component Saved Scene.skp (2.6 MB)

2 Likes

Maybe this is the problem?..

on windows
=current(“lenx”)*2.54 works
0.0 not found error is not same as circular reference. Likely the " " is not recognized, they may be smart quotes on your machine

maybe a purge? 2.6 MB

Yeah, it was those annoying smart quotes. Thanks, turning them off seems to have fixed the issue with the errors, however the replaced components are losing their attributes again now…

I’ll try @MikeWayzovski’s suggestion a bit later today, although I’m not 100% on what he is suggesting. It seems to me that I do have this wrapper component already, but I’ll to wrap it again.

Okay, so the solution seems to be to NOT use the LenX, LenY and LenZ in the outermost component (the one exported) as inputs. If I create three other custom attributes, say SizeX, SizeY, and SizeZ, and then use the formulas =SizeX, =SizeY and =SizeZ for the LenX, LenY, and LenZ respectively, then it works nicely after using rightclick → dynamic components → swap, but not the right-click, reload.

Hi, Thank you for the reply. I think I finally understand “Wrapping” of components. Now I have to go redo all or most of my DCs. :persevere: Thanks again for the help!

Jeff

Hi Mike,

I thought I had it figured out, but there is still an issue. When I change the Height attribute in the model you posted the Axis does not follow the DC. I need the height parameter to be relative to the drawing origin. In other words, if I set the height to be 700 mm it needs to be 700 mm up from the drawing origin. If I set a height in the dialog, say 500 mm, and then move it with the “Move” tool the dialog remains at 500 mm instead of showing the new height of the DC. :thinking:

Thanks,
Jeff

Mike,

OK, I figured out that moving the Height parameter out of the child and to the parent solves my issue. Is that the best way to go about this?

Thanks,
Jeff