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: 

making curves that update when parameters are changed

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
billydebenham
394 Views, 4 Replies

making curves that update when parameters are changed

Seems like a very simple solution, but I am unable to make it work with the API. I can make a script that makes a complicated curve that I need for my research based on some parameters, but when I rebuild the part with new parameters the curve generated by the script remains the same even though I've changed the parameters it depends on. How can I get this to update? I'm a physicist so I don't use CAD stuff all that much so sorry if this is super simple. I've searched the forums. I've attached the code I'm using.

4 REPLIES 4
Message 2 of 5
JesusFreke
in reply to: billydebenham

It doesn't look like you attached the code 🙂

 

 

Message 3 of 5
billydebenham
in reply to: JesusFreke

Thanks! lets see if I did it right this time!

Message 4 of 5
p.seem
in reply to: billydebenham

Although the output of a script goes into the design timeline, the script itself isn't parametric.  That is, when you run your script it pulls the current 'r0' and 'faceWidth' value and uses that to make the sketch.  If you then change the user parameter, the Fusion never actually re-runs the script, it just recomputes any features made from the sketch the script generated.

 

That's all a bit muddy.  What it means is that you'd need to actually re-run your script any time the parameters change.  In your case, this will create a new sketch drawn with the new parameters, so you'd have to manually (or programatically) remove the old sketch and associate any subsequent features with the new sketch.

 

It's certainly not an ideal solution, but I haven't seen an alternative to re-running the script in order to use the new user parameters.

Message 5 of 5
billydebenham
in reply to: p.seem

Thanks for the reply! I kind of stumbled upon that method but was wondering if there was a better way.

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