I need to develop some If statements to correct the pushpull direction of several entities
related to a Door Ruby, I'm currently developing.
Currently this Ruby has no problems if the user installs only left swinging door
in either the yz or xz planes.
However if the user installs right swinging doors the pushpulls need to be reversed.
I have observed the following conditions:
#Pushpull OK
#left hand door in yz plane:
$Vec1 = $pt0 - $pt1
$Vec1 = Vector3d (0, 48, 0)
#Pushpull OK
#left hand door in xz plane:
$Vec1 = $pt0 - $pt1
$Vec1 = Vector3d(-48, 0, 0)
#pushpull needs to be reversed
#right hand door in yz plane:
$Vec1 = $pt0 - $pt1
$Vec1 = Vector3d(0, -48, 0)
#pushpull needs to be reversed
#right hand door in xz plane:
$Vec1 = $pt0 - $pt1
$Vec1 = Vector3d(48, 0, 0)
I can see that -y value from one expression and the x>0 value from the other are the conditions
needed to reverse the pushpull.
Question: how do I extract the -y value and the x>0 value into a working if statement?
TIA