Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

[Add-In] user-parameter driven results - is this possible?

OceanHydroAU
Collaborator

[Add-In] user-parameter driven results - is this possible?

OceanHydroAU
Collaborator
Collaborator

Pardon my newbie question:

 

My add-in creates a sketch, based on inputs from my user.  Does Fusion360 have a way to tell me *later* if any of those parameters have changed, so my Add-in can update what it did?

 

My *guess* (I'm a programmer) is that fusion 360 should be "remembering" everything it fed in to my command, along with the output of my command - and later if anything changes, it should auto-magically "erase" what my command originally outputted, re-run my command with the (now updated) input that it "remembered", so my add-in can re-output the updated solution.  Or, more usefully, instead of "erase", allow me some mechanism to instruct it how the new output differs from the original output (e.g. in my case - give updated locations for a range of points along which a spline has been built) - which probably means giving me a copy of both the old and the new inputs, and allowing me some way to explain back to it which bits I originally provided (e.g. list of sketch points) and how they are now changed.

 

For example - I've got these 2 user parameters (chord_len and max_speed):

Screen Shot 2020-05-01 at 8.35.10 pm.pngScreen Shot 2020-05-01 at 8.39.12 pm.png

I created a sketch with a line that is chord_len long.

 

I run my addin and use it to select the two points at the start and end of that line, and enter max_speed into my addin command entry panel like so:

Screen Shot 2020-05-01 at 8.40.43 pm.png

Which inserts my result:

Demo_Fan.png

Right now, if I move any of the points, or change any of the user parameters (chord_len or max_speed), my add-in is not being consulted, so the previously-inserted shape which is still showing, is now really wrong (wrong size, and wrong geometry for the new flow regime). 

 

I am "hooked in" to  ValidateInputsEventHandler, InputChangedEventHandler, and CommandEventHandler - I was expecting that last one to get called again when I changed stuff.

 

a) Is this possible, and

b) if yes, what's the high-level answer for how this works and what I need to do/use ?

 

Chris.

 

 

0 Likes
Reply
381 Views
1 Reply
Reply (1)

BrianEkins
Mentor
Mentor

It's not currently possible to have your add-in respond to modeling changes.  The best solution I've come up with is a separate command button that the user can click to force an update.  Ideally, this same process would have been automatically triggered by my add-in responding to a model changed event.  Instead, the user can manually force the update.  I use this for my Nifty Dogbone add-in.  It's still not simple to implement.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes