How to trigger Dynamo script after triggering an event (such as synchronizing to central model)

Hey all, I have created a Dynamo script which checks to see if the projects pile coordinates are up to date. Currently it is triggered by a ribbon push button, however, I would like to trigger the script after certain events have taken place (such as syncing, printing etc). Sadly, I am struggling to find any solid guidance on how to make this happen and would appreciate some guidance.

Thanks in advance!

Because it’s fairly unstable.

The only way to do this is via an event listener, which can be VERY difficult to control and can cause greater instability with Revit. You’re far better served to move to a full add-in if you want stability.

This thread here has some more info on setting one of these up for renumbering views on sheets, but proceed with extreme caution.

Thanks for the quick reply and interesting read. I am new to C# so will look into writing a custom add-in as this does sound like the best solution.

Although, before I completely give up on the Python/Dynamo/pyRevit route…

I have created a Python event listener which when triggered, displays a text pop dialog box. Is it possible to replace the dialog box with code that will:

  1. Retrieve Dynamo script from e.g 'C:\Users\USERNAME\AppData\Roaming\pyRevit\Extensions\TOOLBAR.exteQnsion
  2. Execute said Dynamo script

Or would i have to rewrite my dynamo script first as python code and embed this within my event listener?

Not sure - listeners/updaters aren’t supported workflows in the context of Dynamo, so you’re going to have to experiment on your own. Be sure to let us know what you find!