Hi @william-c-anderson .
It is interpreted that UserParameters changes are made in the GUI.
The following code displays a dialog when the OK button is pressed.
#Fusion360 python adinn
import adsk.core, adsk.fusion, adsk.cam, traceback
_handlers = []
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
class CommandHandler(adsk.core.ApplicationCommandEventHandler):
def __init__(self, targetCommand):
super().__init__()
self.tgtCmd = targetCommand
def notify(self, args):
try:
if _ui.activeCommand == self.tgtCmd:
# Here, the change of UserParameters is checked.
_ui.messageBox('call ' + self.tgtCmd)
except:
if _ui:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def run(context):
try:
global _app, _ui
_app = adsk.core.Application.get()
_ui = _app.userInterface
onCommand = CommandHandler('ChangeParameterCommand')
_ui.commandTerminated.add(onCommand)
_handlers.append(onCommand)
print('--- Start addin ---')
except:
if _ui:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def stop(context):
try:
for hdl in _handlers:
_ui.commandTerminated.remove(hdl)
_handlers.clear()
print('--- Stop addin ---')
except:
if _ui:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
At this point, you should check that UserParameters has changed since the previous call.