DCs with ZERO or more copies of an element

Continuing the discussion from Change total length of rectangle frame without change its thickness?:

No matter what, you have to have the subcomponent definition included as part of the overall component. And I’m guessing that setting the hidden attribute eliminates any drawing activity. So I’d say that setting the hidden attribute of a component with copies=0 is functionally identical to suppressing the drawing.

Thanks. I’ll have to try that as the best feasible. But it will show with View/Hidden Geometry turned on though. Not a deal breaker.

Try forcing the LenX ,LenY and LenZ to adjust to 0 , you can’t see the subcomponent, then.

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.
A
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.

HMMM!
I changed the Height attribute name from Height to 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.

Latest version:
Frame - vertical plane DC.skp (150.2 KB)

1 Like

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