making curves that update when parameters are changed

making curves that update when parameters are changed

Anonymous
Not applicable
974 Views
4 Replies
Message 1 of 5

making curves that update when parameters are changed

Anonymous
Not applicable

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.

Accepted solutions (1)
975 Views
4 Replies
Replies (4)
Message 2 of 5

JesusFreke
Advocate
Advocate

It doesn't look like you attached the code 🙂

 

 

Message 3 of 5

Anonymous
Not applicable

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

Message 4 of 5

p.seem
Advocate
Advocate
Accepted solution

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

Anonymous
Not applicable

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