Extracting Ball Joint Euler Angles

Extracting Ball Joint Euler Angles

Anonymous
Not applicable
674 Views
2 Replies
Message 1 of 3

Extracting Ball Joint Euler Angles

Anonymous
Not applicable

1) Are ball joint Euler angles accessible as parameters?  Can't find parameter names.

 

2) Should angles be accessible with something like this?  What attribute extracts the value of the property: yaw ?

 

# Extract yaw, pitch and roll angles for a ball joint named 'Ball Joint'

ballJoint = root.joints.itemByName('Ball Joint')

yaw =   adsk.fusion.BallJointMotion.yawValue 
pitch = adsk.fusion.BallJointMotion.pitchValue
roll =  adsk.fusion.BallJointMotion.rollValue

yawMsg =   'Yaw =   {:.3f}°'.format(math.degrees(yaw.???))
pitchMsg = 'Pitch = {:.3f}°'.format(math.degrees(pitch.???))
rollMsg =  'Roll =  {:.3f}°'.format(math.degrees(roll.???))

Thanks

 

 

 

0 Likes
Accepted solutions (1)
675 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

 

1) Still haven't found the Euler angle parameter names, but

 

2)This extracts the angles (note a little renaming from first example):

 

rodEnd = root.joints.itemByName('Ball Joint')
rodEndMotion = adsk.fusion.BallJointMotion.cast(rodEnd.jointMotion)

yaw = rodEndMotion.yawValue
pitch = rodEndMotion.pitchValue
roll = rodEndMotion.rollValue

msg = 'Yaw = {:.3f}°\nPitch = {:.3f}°\nRoll = {:.3f}°'.format(math.degrees(yaw), math.degrees(pitch),  math.degrees(roll))

 

 

 

 

 

 

0 Likes
Message 3 of 3

BrianEkins
Mentor
Mentor
Accepted solution

Those angles don't exist as parameters.  You can see below the parameters that are created for a ball joint.

BallJoint.png

 

The yaw, pitch, and roll are internal values local to the ball joint and are only accessible via the Drive Joint command and through the API using the properties BallJointMotion object that you already found.  Those properties are read-write so you can use the API to change them, which is the equivalent of the Drive Joint command.

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com