No, I hadn’t.
But I HAVE been trying your amended version, and adapted it slightly. I see you have set all the Units to inches, and find it puzzling that it works that way, but apparently it does - with one exception (more later about that).
I wanted to make it scaleable using the scale handles in the X or Z directions, and have succeeded, though with another quirk appearing.
I wanted the X length to be a whole multiple of the PileSpacing, and that was easy, using an example from the Help Centre (https://help.sketchup.com/ko/article/114568) to make a component snap to a specific length.
And I wanted the Piling Height to snap to a whole number of mm. So I tried putting in the formula
PilingHeight = Round(Current("LenZ") - EdgingHeight)
before noticing that you had set all the units to Inches.
This rounded the height to the nearest inch, but displayed it in mm.
So I thought: the units are inches, if I multiply them by 25.4. they will convert to mm, so this ought to do the trick:
PilingHeight = Round(25.4 * (Current("LenZ") - EdgingHeight)/25.4)
And it simply doesn’t work - or else my logic is wrong here?
[EDIT - Yes it is! Should divide before multiply. But when I fix that, it still doesn’t work, and rounds to whole inches, or tenths of inches, If I give it a second parameter to round to one decimal.
PilingHeight = Round((Current("LenZ") - EdgingHeight)/25.4,1)*25.4
When I changed the units for PilingHeight to cm, removed the 25.4 factor, and round to 1 decimal of cm, it DOES work correctly - the PilingHeight correctly snaps to the nearest 1mm.
So I thought: why not make ALL the attribute units into cm?
Tried that - doesn’t work. Changed (for example) PileSpacing to cm. Goes crazy again, and shrinks everything by the (surprise!) factor of 2.54 again.
This is simply nuts.
Anyway. I now have a DC that does what I set out to do, which was to make it easy to explore alternative designs of length, height, and pile size of harbour wall in a small model railway layout being developed by a friend, using inputs in mm.
A VERY BIG THANK YOU MIKE! I’d have given up long since without your help.
Here’s the version I’m going to go with.
Harbour wall DC.skp (2.5 MB)