Community
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.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

jointMotion angle change not working with linked component

0 REPLIES 0
Reply
Message 1 of 1
quality5B59E
148 Views, 0 Replies

jointMotion angle change not working with linked component

I have a Palette with sliders moving joints on a robot through the API.

This works when the robot is not a linked component.  However, when the robot is

a linked component, moving the sliders doesn't do anything.  Doesn't crash or give

any error messages.  Breaking the link makes it work.

 

Do I have to do things differently when a component with joints is linked?  I tried

calling refresh() but that doesn't seem to help.   Weirdly, if I go through the browser UI

and use "drive joints", it works even when linked so maybe the UI is doing something different?

 

Can anybody help?  Here is my code below.   Thanks!

 

if cmd == 'joint_changed':
                # joint position slider was moved
                # get slider position
                joint_num = data['joint_num']
                joint_name = "joint{}".format(joint_num)
                joint_angle_deg = float(data['joint_angle_deg'])
                # update model joint
                robot_comp = find_comp(CNAME_XARM)
                if robot_comp:
                        # doing directly to jointMotion
                        joints = robot_comp.joints
                        joint = robot_comp.joints.itemByName(joint_name)
                        rev_motion = adsk.fusion.RevoluteJointMotion.cast(joint.jointMotion)
                        rev_motion.rotationValue = (joint_angle_deg / 360) * 2 * math.pi
                    

 

 

 

0 REPLIES 0

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