Stumped by strange behavior in dynamic component rotation for one specific angle

Well, this sure is a weird one! I’m hoping someone can either show me WHY it behaves like this, WHAT I’m doing wrong, or confirm that it really is a bug…

This is the issue: The behavior of the rotation and spacing for a group of objects is different for only the one specific angle of exactly 15°. It behaves as expected for all other angles I tried (eg, 14°, 16°, 30°, 0°, 90°, etc), but for 15° it goes crazy. And this ONLY occurs if you type an equals sign before the angle, in the Attribute field. If you type the number without the equals sign, then it also works fine.

Explanation: I’m trying to model a set of acoustic “hangers”, which are basically just thin wood panels with insulation glued on each side, used in recording studios for various purposes. They are basically analogous to a vertical window blind, where you have a series of long thin “vanes” hanging down vertically, with certain fixed spacing between them, and you can also set the angle of rotation to open or close the blinds. I have modeled all of that using Dynamic Components to set the height, width, thickness, spacing and rotation of each “vane” or “hanger”. It all works fine, for every single angle … EXCEPT 15°, and ONLY if I type in “=15°”. If I type in just “15°” (without the equals sign), then it behaves as expected, rotating all of the vanes to an angle of 15°, with the spacing set to 30cm. But when I type in that “=15°” and hit “Redraw”, the spacing jumps to what looks like maybe 80 cm, and the angle changes to the strange number: 5.905511811023622. I have NO idea why! I checked everything I could, and I can’t see why this would happen.

I have tried setting the attributes for that angle to “Text” and also “Decimal number”, but there’s no difference. I have deleted and re-created the “angle” attribute, and tried everything else I can think of. But it remains the same: for that one specific case of typing in an equals sign and the number 15, all hell breaks loose. For every other angle, with or without the equals sign, it behaves as expected. Even for slight variations, such as 15.000001, or 14.99999 all is fine. But not for 15…

Model attached.
DYNAMIC-acoustic-hanger-set-S02.skp (213.4 KB)

Anybody care to take a crack at this, and see if maybe I’m nuts, or there really is a bug in Dynamic Components?

I can’t see it going “crazy” here, it seems to be working fine. I can enter 15° no problem and it works. I checked with the protractor tool and it had rotated it 15° from the red axis. The only thing I changed was to make HangerRotAngle editable:
"Users can edit as a textbox"
The file you uploaded had it set to “Users can see this attribute”.

Have you tried restarting SketchUp?

Thanks for trying, but the issue does not happen when I add a text box for that attribute: it’s only when you type into the “Attributes” field directly, in the “attributes” window, not the “options” window. And only if you precede it with an equals sign. Sorry, I should have mentioned that. Please could you try it using only the Attributes window.

Thanks!

OK, it is going crazy now, I’ll have a look…

You have the units set to inches, but you’re specifying cm sizes for most of the variables except HangSpacing. I’d say it was behaving weird for every angle except 15°. At 15°, the spacing is 38.1cm which is 15 inches. It’s weird, like the spacing is interpreted as cm mostly, then inches when the angle is 15.

If you change HangSpacing to “15 cm” it works.

This does look like a bug for everything except =15, as =15 is working fine: it gives you 15 inch spacing as you asked for.
It seems to get confused when two of your variables are “=15”.

DYNAMIC-acoustic-hanger-set-S02 2.skp (288.7 KB)

Why, in the first place, do you want to use the equals sign? It is used in front of a formula. I don’t know why 15° amounts to 5.905511811023622 when interpreted as a formula.

It sure is strange, and thanks for confirming that it’s a bug. I suspected as much, but didn’t want to appear silly reporting something that isn’t a bug.

The fact that setting one attribute would cause a change in another attribute that is totally unrelated, is very scary. Where else might this bug show up, in a complex model? Why should the “spacing” change, when it is not related in any way to the angle? The “spacing” attribute has no connection at all to the “angle” attribute, so I really don’t understand why it would change, and only for one specific set of conditions.

And why should there be a problem with typing in the number “15” to a field that is specifically defined as being in “centimeters”, and actually shows “cm” after the number you typed in? If you click on the icon at the right end of each attribute field, you’ll see that I did, in fact, set them all to “centimeters”, even though I didn’t set the overall units.

Something is definitely buggy here… I’m hoping that Trimble will be able to figure it out… although it seems they are no longer developing Dynamic Components at all… (at least, I haven’t see any development there, in a long time).

Thanks for you help in figuring out the work-around! Much appreciated.

Using the equals sign when it wasn’t a formula was unneccesary but it still should have worked. I never saw the 5.905511811023622 value myself, just the spacing changing.

I see now that when I click the icon at the right, you had indeed set the unit to cm.
The handling of units is buggy in DC, it seems to default to inches when anything goes wrong. I gave up on DC years ago and found I had much more control in Ruby scripts. Even in Ruby, SketchUp uses inches internally and you have to convert any other unit.

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