Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to turn a revolute joint in a C++ script

Message 1 of 2
174 Views, 1 Reply

How to turn a revolute joint in a C++ script

I've got a a joint that I've picked up from a JointsList...

Ptr<Joint> ThisJoint = JointsList->item(0);


and I do know that it's a revolute joint, although I only know that because I also check the NAME that I gave to it. So my first question is how can I determine the actual "type" of joint from my ThisJoint object.

But more importantly, once I have hold of the revolute joint,how do I, using a C++ script, cause the joint to actually rotate? What method do I call? And do I have to call something extra in order to get the image to update so I can actually SEE the rotation occurring?

Message 2 of 2
in reply to: RogerInHawaii

-> see Learning page  RevoluteJointMotion API Sample


Here is some condensed code with the key points:


Ptr<RevoluteJointMotion> motion = joint->jointMotion(); 
// jointMotion() is property of Joint
// RevoluteJointMotion is a derived class from JointMotion
JointTypes type = motion->jointType(); 
// JointTypes => ENUM for type => if you just want to find out the type (first part of your question) 

bool isOk = motion->rotationValue(1.57);	// change angle 


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report