Attribute Scope

I have three nested components called pop, bubba, and littlebubba (parent, child, grandchild components). In pop I set a custom variable called popvar which is set to a number. In littlebubba I try to set the position X to pop!popvar and I get the red error with the hash. So, I move the littlebubba up to be a sibling with bubba (both are now direct children of pop) and the red error persists. If I then remove the attribute from littlebubba and retype it, it works. Some questions:

  1. Is there a way to scope an attribute variable to see up more than one generation?
  2. Is there a way to refresh the evaluation of variables so I don’t have to delete and recreate?
  3. Is this system too weak to be used with any reliability (I’m seeing strange behaviors and reading confused users that makes me think it isn’t a solid platform for complex work)?

In general, the scope of a components attribute is three levels: one up, one down and the context level where it resides. Consider the model (drawing), level 0. Then, the deeper the nested components the higher the level of indention will be.

  1. There is a way. All nested components should have the same named attribute and a formula that refers to the parent (e.g. popvar=PARENT!popvar)
    That way, only the highest level components have to get the value from a ‘sibling’ and all the deeper levels will inherit that value with a redraw. (=2.)
    Check this simular post
  1. The system is in it’s intentional form very strong, I think and full off possibilities, but unlike the intuitive SketchUp learning curve has its flaws and little hickups. I always see it as ‘program’ puzzles, but the real power comes when you add metadata which you can easily acces in LayOut with the label tool

Hey Mike,

Thanks so much for the great answer. I hadn’t seen the redraw! Duh!

I think I get the idea. I have remaining questions (if you have remaining time:slight_smile:)

Is there any reason to use the component name or is PARENT! better? When I used the component name, it seemed to fail a lot when moving parts around and regrouping (which is the obvious problem with the scope needing to be explicitly inherited).

I haven’t needed it yet, but if PARENT! is looking up a level, is CHILD! what I use to look down?

Are there docs anywhere for all of this?

Thanks again for your time.

To look down, you must use the proper group/component name, as the number of “children” is not limited.

1 Like

Ha! Well that is a bit embarrassing…I didn’t think that through before asking. Thanks for your time!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.