Dyno - Automatically trigger a script to run

Hi All,

Does anyone know if its possible for Dyno to trigger a script once an action happens?
For example if someone clicks sync, dyno automatically runs a script?

I notice Dyno seems to open the dynamo core on startup so presumably something is running in the background.

I know its possible if i were to create my own ‘real’ add-in, but wonder if theres an alternative?

1 Like

A year later, but just seeing if anyone knows if this is possible or not?

Currently I’m using @john_pierson’s Relay to run scripts from buttons, which is great.
And I believe that python scripts can be run using hooks in PyRevit, but whether its possible to trigger a .dyn when someone syncs (for example) is the part I’m unsure about.

Does anyone know if this is possible?

Thanks in advance
Paul

1 Like

I haven’t had any luck with this using pyRevit, only hooks written as pythom scripts. I expect if you programmed an addin to run dynamo in the background it may be possible, but havent seen one that does this to date (only run when button clicked).

Sure, as an addin you can listen to events and execute code on these events. Not sure how you’d do it with dyno though as I’m guessing there is no builtin option to hook the dyn file execution on these events… Maybe a feature which could be added to Dyno or Relay by giving user ability to bind scripts to events. @john_pierson?

Thanks @Daniel_Woodcock1 and @GavinCrump.
Sorry for the confusion - I was playing around with Dyno when i created the topic originally, but using Relay at the moment due to its simplicity.
Good to know it’s possible!

1 Like

This is definitely something I have messed with in the past. (Even before Relay) I would love to have hooks for DYNs.

Initially, I had a text parameter on family instances that pointed at a DYN path. And anything the family was modified the DYN ran (slowly) but it ran.

If someone wants to toss it on the Relay github issues as a feature request, we can see what we can do when time allows. :grin:

2 Likes

Very cool John, sounds brilliant, added to the github issues as a feature request:

https://github.com/johnpierson/Relay/issues/9

Thankyou @john_pierson

1 Like