Page 3 of 3

Re: Check Snap Orientation with if condition

Posted: November 6th, 2022, 8:24 pm
by Fatty-Do-Do
balala wrote: November 6th, 2022, 8:13 pm An improvement of the code: I replaced the [MeasureTangent] measure with the following [MeasureOrientation]. This measure returns a number which represents the number of degrees from the upper vertical line (drawn from the center of the screen to the center of its upper edge) to the line drawn from the center of the screen to the center of the skin, as shown below:

Degree.png

Having this number, you can extremely easily create the proper IfConditions to get the desired result. Hope you got how...
The code of the measure (only the measure, with no other sections and no IfConditions):

Code: Select all

[MeasureOrientation]
Measure=Calc
Formula=(( 360 + Deg ( Atan2 (( #WORKAREAWIDTH# / 2 - ( #CURRENTCONFIGX# + #CURRENTCONFIGWIDTH# / 2 )), ( #WORKAREAHEIGHT# / 2 - ( #CURRENTCONFIGY# + #CURRENTCONFIGHEIGHT# / 2 ))))) % 360 )
DynamicVariables=1
Well thanks, that works brilliantly and reduces the code quite a bit. :rosegift:

Re: Check Snap Orientation with if condition

Posted: November 6th, 2022, 8:29 pm
by balala
Fatty-Do-Do wrote: November 6th, 2022, 8:24 pm Well thanks, that works brilliantly and reduces the code quite a bit. :rosegift:
Did you try it out? Does work?

Re: Check Snap Orientation with if condition

Posted: November 7th, 2022, 10:03 am
by Fatty-Do-Do
balala wrote: November 6th, 2022, 8:29 pm Did you try it out? Does work?
It does. I just defined the IfConditions as =0<#CURRENTSECTION#<45, 45<#CURRENTSECTION#<90, etc. and that worked brilliantly. Thanks again :thumbup:

Re: Check Snap Orientation with if condition

Posted: November 7th, 2022, 3:44 pm
by balala
Fatty-Do-Do wrote: November 7th, 2022, 10:03 am It does. I just defined the IfConditions as =0<#CURRENTSECTION#<45, 45<#CURRENTSECTION#<90, etc. and that worked brilliantly. Thanks again :thumbup:
Glad to help.