What's the event listener for user parameter changes?

What's the event listener for user parameter changes?

Anonymous
Not applicable
582 Views
2 Replies
Message 1 of 3

What's the event listener for user parameter changes?

Anonymous
Not applicable

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)
0 Likes
583 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor

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
0 Likes
Message 3 of 3

Anonymous
Not applicable

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

0 Likes