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: 

What's the event listener for user parameter changes?

2 REPLIES 2
Reply
Message 1 of 3
snoyes78783
256 Views, 2 Replies

What's the event listener for user parameter changes?

I have written an add-in which reads the list of user parameters and changes some sketchTexts. It works when I run it via a button on the toolbar, but I want it to update automatically if I add or change a parameter's name or value. What event listener can I use to watch for changes to the user parameters?

 

It's similar to the "Maintaining User Parameter references" question, but in that case the solution was addRadialDimension, and in my case there aren't any dimension types I can use because I'm changing the text of a sketchText, which is not dimension driven.

 

# Event handler for the commandCreated event.
class ParametricTextCreatedEventHandler(adsk.core.CommandCreatedEventHandler):
    def __init__(self):
        super().__init__()
    def notify(self, args):
        eventArgs = adsk.core.CommandCreatedEventArgs.cast(args)
        cmd = eventArgs.command

        # I *think* I add something here to listen for a change in user parameters. But what?
# cmd.something? # Connect to the execute event. onExecute = ParametricTextExecuteHandler() cmd.execute.add(onExecute) handlers.append(onExecute)
2 REPLIES 2
Message 2 of 3
BrianEkins
in reply to: snoyes78783

It's not currently possible.  The events supported by Fusion are limited.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 3
snoyes78783
in reply to: BrianEkins

There's no way to monkey patch the Change Parameter command's inputChanged listener to add a call to my function?

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