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: 

Important Note for API Clients

3 REPLIES 3
Reply
Message 1 of 4
keqingsong
652 Views, 3 Replies

Important Note for API Clients

We just released our May 2020 product update, and we've made some tweaks to the API.

 

We've put in extra efforts to make Fusion 360's 3D modeling operations even more stable. That required performing stricter validation checks on inputs before performing any operation. Earlier an Add-In could request an operation with some invalid inputs, and Fusion used to accept them and tried to generate (potentially unstable) output if it can. After this update, Fusion 360 will start rejecting such requests and will error out. Unfortunately, that could mean potential breakage of your Add-Ins, if they performed such an operation.

Here's a simple example of what an 'invalid' input looks like:

...

# Sketch circle created with some arbitrary radius 
circle = sketch.sketchCurves.sketchCircles.addByCenterRadius(center, radius)

# Extract sketch profile out of it
profile = sketch.profiles[0]

# Adjust the circle radius
# BAD! Because this will make the 'profile' invalid.
# You should either do this before fetching the profile from sketch, or should re-fetch the profile now
circle.radius = 5
        
# Create sweep (without re-fetching sketch profile)
sweepFeats = feats.sweepFeatures
sweepInput = sweepFeats.createInput(profile, path, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
sweepFeat = sweepFeats.add(sweepInput)

...

This used to work fine earlier as Fusion 360 was forgiving. But as this could lead to instabilities down the road, the sweep operation will fail from now on. This is just one example of many ways to make something invalid. Add-In authors would be the best judges of how it affects their scripts.

 

If you're an Add-In author and need any assistance with this, please don't hesitate to reach out to us


Keqing Song
Autodesk Fusion Community Manager
Portland, Oregon, USA

Become an Autodesk Fusion Insider



3 REPLIES 3
Message 2 of 4
OceanHydroAU
in reply to: keqingsong

Thanks for letting us know.  Could you spare a moment to tell me if it's possible for our API to "hook in" to change events (e.g. updated user parameters)?  I've described it here:

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/add-in-user-parameter-driven-results-is-th...

Message 3 of 4
kandennti
in reply to: keqingsong

I am sorry that I wrote a cheeky matter.

 

I feel that the fact that I don't know whether getting a property is "deep copy" or "shallow copy" is a misleading reason.

 

Also, the method called "copy" is similar. Deep copy is easy to understand if you give it the name "clone".

Message 4 of 4

Thanks for the info @keqingsong

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