Interesting!!! If I set the code to make the crosspiece HIDDEN attribute True when I set the number of crosspieces to 0, it is NOT visible as Hidden Geometry.
Even odder, although I typed in the formula to the Hidden attribute for the crosspiece
=IF(Parent!Num_Xpieces = 0, True, False)
I THOUGHT it only ever displays FALSE when I view the Attributes now. The formula has vanished, but the behaviour remains!
[LAATER] The forumula vanished because it wasn’t valid. I’d missed an underscore in an attribute name.
It works, but puts the hidden crosspiece at the location of the upper stile. And it IS visible with hidden geometry on.
BUT - I see when I change the option to have the long sides of the frame horizontal, that the crosspiece has moved up to overlay the top stile.
[LATER STILL] Solved - I’d got the formula wrong. See above - i’d previously written the variable as
NumXpieces and it should have been
Num_Xpieces with the underscore.
Will now try also setting LenX, Y and Z to zero instead or as well. That does the trick. Nothing visible, even with hidden geometry on.
couple of examples
The option values are just in alphabetical order. I should probably rename them with a prefix letter to sort in a more logical sequence. Does the DC automatically refactor the attribute names in the formulae, I wonder - if so, will try it.
I changed the
Height attribute name from
a_Height. And got a new attribute, but it propagated to the formulae, and kept the old attribute as (lower case)
height on the line below. I vaguely remember a previously reported bug, where renaming an attribute didn’t work properly, but changed ANY references that INCLUDED that name, whether or not only part of a different attribute name.
So not trivial to change everywhere. Will leave it as it is,. at least for now.
On looking at it again, I wonder if it would be better to rename
Long sides to
Overlap? It’s just to determine whether the sides or the top/bottom overlap the other pieces.
Found another bug, too. Hadn’t set the X position of the crosspieces.
Here’s the attribute set for the crosspiece now:
Make a quick set of shelves too, if you set the Stile and Upright widths to 1" nominal, and the Thickness to maximum. I should increase the possible value ranges I think, to include at least a deeper thickness to make shelves.
Frame - vertical plane DC.skp (150.2 KB)