Stair railing resizes incorrectly

Here is what one of the original designers of the DC has to say about it:

Here’s the idea. Before something is a DC, it’s reported width is equal to what is on screen. However, at the moment a positioning formula is added to one of its parts, its reported width can get out of sync with what is one screen. Consider this series of steps:

  1. I draw a 4-piece frame that is 100cm wide
  2. I look at it inside the Component Attributes window and its LENX is 100cm. So far so good.
  3. I add a formula to the right piece where its X=parent!lenx. This moves the piece “outside” the size of the parent, to the far right of the parent component.
  4. The LENX of the entire frame is STILL reported as 100cm, even though on screen it is wider (100cm plus the width of my piece.)

This may seem weird at first, but consider what would happen if the reported width were always updated to the onscreen width. My frame was 100cm wide, so the right piece moves to 100 cm, so the frame becomes 110 cm wide, so the right piece moves to 110cm, so the frame is 120 cm wide, etc. etc. etc. Every time you redrew your DC, the frames would grow. It’s a kind of geometric circular reference.

So the software’s behavior is as described above: at the moment you add a formula to a DC, its on screen width gets stored inside the DC, and formulas are driven off of that. If you scale a DC, the internal width is updated and the formulas are fired again.

see this thread on sketchUcation

in addition, you better use a custom attribute in stead of the LenY of the component itself

1 Like