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: 

I'm trying to drive a revolute joint via script with a contact set but the anima

0 REPLIES 0
Reply
Message 1 of 1
typ1804
228 Views, 0 Replies

I'm trying to drive a revolute joint via script with a contact set but the anima

I'm trying to drive a revolute joint via script with a contact set but the animation is only half there.

 

It works with the contact set disabled but as soon as I enable the contact set the revolution works only until the two components touch. Then the whole animation stops until the components would stop touching. After the two components stop touching the animation is back on track. Its seems like its missing the contact set animation.

 

The model is the Example Geneva Drive and I want to drive the rotor together with the cross as seen in this tutorial https://www.youtube.com/watch?v=UkGdrTyAaBg just automatically via script

 

#Author-
#Description-

import adsk.core, adsk.fusion, adsk.cam, traceback, math

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        des = adsk.fusion.Design.cast(app.activeProduct)
        root = des.rootComponent

        joint = root.joints.itemByName('Rev2')
        rev = adsk.fusion.RevoluteJointMotion.cast(joint.jointMotion)
        
        for i in range(360):
            rev.rotationValue = i * (math.pi/180)
            adsk.doEvents()

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
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