How do you access object attributes outside of self,sibling or parent

To get to a self attribute
Attribute = some formula with attributeName

To get to sibling attribute
Attribute = some formula with SiblingName!attributeName

To get to parent attribute
Attribute = some formula with ParentName!attributeName

If I try to get to a grandparent attribute
Attribute = some formula with GrandParentName!attributeName
I get an error

1 Like

You can only get to attributes of components contained within the same top level component. Within that context, you can access any attribute with:
ComponentName!attributeName

If you leave out ComponentName!, you are referencing an attribute in the same component as the reference.

There is 1 other, generic reference available:
parent!attributeName which references attributeName in the component which is the immediate parent of the referencing component.

So, to get to an attribute of a GrandParent, you have two choices:

  1. Just use the name of the grandparent: GrandParentName!attributeName or
  2. Add a custom attribute to the PARENT. In that attribute, use parent!attributeNameinGrandParent, then in your attribute, again use the parent!attributeNameinParent

Just thinkin’ out loud here: Can we chain ? ie, parent!parent!attributeName ?

It sure would make things simpler.

1 Like

That would be nice, but I don’t think it currently exists.

What would be a real world use case? I’m guessing a small fraction of DCs even have 3 levels, and at that point, they’re fairly complex components where the designer must already keep careful track of sub component names.

What was driving this was the desire to have global variables for the entire project. I would like to have a global variable with length and height for the entire project. Is there a way to have global variables?

David Bolt
Founder
865.603.0520 Cell & TXT
DwBolt@Sustainablefuture.biz mailto:DwBolt@Sustainablefuture.biz Email
www.SustainableFuture.biz http://www.sustainablefuture.biz/ Web
Newsletter Signup http://sustainablefuture.biz/about-us/newsletter-signup/

Only way I can think of is to enclose your entire project in one component.

What I’ve ended up doing is creating a DC at the top level called _Param where all my global variables are

All the top level DC have access via _Param!{name}

Here the Back wall needs to know how big it is based on the the floorLenx,
so It pulls it from the _Param

Bottom (the Bottom plate, get info from it’s parent).

This all is a bit labor intensive, but it makes information path’s very visible.

Thanks for the ideas and help

David Bolt
Founder
865.603.0520 Cell & TXT
DwBolt@Sustainablefuture.biz mailto:DwBolt@Sustainablefuture.biz Email
www.SustainableFuture.biz http://www.sustainablefuture.biz/ Web
Newsletter Signup http://sustainablefuture.biz/about-us/newsletter-signup/