Rotate DC "minus values"


#1

Hi All,

I created a door and want to open it 90deg. I entered the formula
"animate (RotZ,90,0)" and it works perfectly.

If i want to open the door minus -90deg. I entre the formula “animate (RotZ,-90,0)”

With this formula i can open the door but i can’t close it. It create a new custom attribute “-90” and the formula get stuck

I tried to add quotation marks “-90” but it still doesn’t work.

thanks for your help,

Simon


#2

Try rotating by 270º ?


#3

Works with +ve AND -ve angles.
Note the “” around the RotZ attribute, this protects it from messing up on the Ruby side when it is interpreting the negative angle…


#4

Thanks mate, rotating 270 works.


#5

@ TIG

Thanks, i tried it out but it doesn’t work, see attached file. An Error comes up "invalid entity to animate:(“RotZ”).

Doors.skp (63.2 KB)


#6

@svf

It will work with -ve angles IF the attribute like “RotZ” is included in proper “double-quotes”.
If you read what you have typed in the formula…

animate(„RotZ“,0,-90)

It WILL fail because you have typed in something else !
If you typed it as I showed, with “” around the RotZ it works just fine !

ANIMATE("RotZ", 0, -90)

You seem to be typing in some kind of ‘smart-quotes’ - so you need to reset some typing system-preferences somewhere [MAC? See here http://www.macissues.com/2014/11/03/how-to-disable-smart-quotes-in-os-x/ ] - ordinary “double-quotes” are ALWAYS needed in DC formulas which require them…


AND ALSO rotating by 270 is NOT the same as rotating by -90, because the swept arc is bigger x3 !

#7

@ TIG

Thanks for your help mate. That was the issue. No it works perfectly!


#8

I cannot get the double quote marks to function on my Mac


#9

[quote=“dclower, post:8, topic:11361, full:true”]
I cannot get the double quote marks to function on my Mac
[/quote] Don’t use ‘smart-quotes’ [or ‘dashes’] - it’s a setting on MAC.
http://www.macissues.com/2014/11/03/how-to-disable-smart-quotes-in-os-x
You ALWAYS want plain "…"
NEVER use “…”
Also the same for ‘single quotes’.