DC parameter checking
-
I have been working on a number of DC's many having nested components.
I am using the parent referencing (ie =parent!noofbays*500 ) quite heavily as changing the component reference names can affect links down the tree.
What I am bothered about is if the user explodes the top level component, I want to keep the functionality in the nested components. This would require a switch to check for the existence of the parent with a function line such as
= IF(EXISTS(parent!noofbays),parent!noofbaysparent!baysize,localnoofbayslocalbaysize)
Has anyone found a way to do this sort of check?
Also, I havent checked but I assume parent! is the containing component. I wonder with multiple nested levels whether parent! refers to the topmost component or the one containing the current component as assumed above. If so to get up the tree do you use parent!parent!noofbays . I suppose you can use direct name references for the topmost parent anyway. This query is done just to raise debate - I haven't checked yet.
Regards
Bill Wood
-
If you have the option of referencing an attribute in the same component why not do that every time? WOuld save a lot fo hassle with the parent components.
As you said, parent! refers to the containing component rather than the top level component.
-
Remus
Thanks for the response.
My stance is that the topmost component will always contain the source information to build the DC.
Generally, the most important will be a Len attribute derived after scaling. In my case, I round to the nearest bay size based on a LenY for the topmost component.That is why for nested components I use the parent! reference - the LenY for a nested component may be different to that of the topmost component - you may also want to fix Len values. All I was protecting myself against was the user exploding the topmost component and breaking links in the nested components (ie those with the parent! reference)
If I was to use raw attribute names in a nested component, can attributes of a nested component be set from within the functions of the topmost component? I suspect not.
Dont worry, I can happily live with the exploding issue.
As a note, I attached a custom attribute to a nested component with display set to "edit as textbox".
When the topmost component is selected the Component Options dialog doesn't display the custom attribute from the nested component - which is what I expect. -
Hi BillW...
Have you found any solution on the parent!parent! issue?
I need to call a custom attribute from the toplevel component to apply on my sub-sub- component.
Generally i am asking how to define a hierarchy something like:
to get LenX on my sub sub component [hole] to react on the custom attribute of [Box], [hole] is an component nested in [Wall], custom attribute is 'BoxHeight'
LenX =Box!Wall!BoxHeight/2How do i write the path?
Thankyou for any help!
D.
-
@danieldaniel73 said:
Hi BillW...
Have you found any solution on the parent!parent! issue?
I need to call a custom attribute from the toplevel component to apply on my sub-sub- component.Hello Daniel,
Currently, you are only allowed to reference attributes in the parent or in children. If you need a custom attribute of a grandparent to drive a formula inside a grandchild, you have to do it with two formulas instead of one.
Inside the grandparent:
CustomWidth = 10Inside the parent:
InheritedWidth = parent!CustomWidthInside the child:
MyWidth = parent!InheritedWidthThe idea is for each component to live in its own little world, and have the list of what's configurable be dependent on the parent it's inside of.
For example, if you were designing a set of cabinets, you may have a subcomp called "Drawer" that has 10 configurable options on it. But as soon as you nest that inside of a "Cabinet", you may choose to only create pulldowns for 3 of those (by wiring the drawer attributes to be driven by the cabinet's).
At least, that's the vision. There are certainly ways that we can think of to make all of this easier, so please keep the feedback coming!
Advertisement