PyRevit + Dynamo Scripts

When i installed the pyrevit, the first thing i did was translate Dynamo Scripts to PyRevit Python. But if you don't have time or just don't want to, pyrevit gives you the ability to run dynamo scripts. As for example i will take Test Scrypt from pyrevitDevTools. Here what we have:

 

The bundle.yaml file is not necessary in our case. To run a dynamo script using the pyrevit button, you must specify the index '_script' in the name. PyRevit gives us the ability to run additional functionality by running the script using SHIFT + click methode. Here is the same situation, but you need to name another script with the index '_config'. When you press SHIFT + click, then the _config script loads.

Shortly about bundle.yaml file. According to PyRevit documentation:

DynamoBIM Engine Configs

Dynamo has an option to shutdown the executor after running the dynamo script. This means that scripts take longer to run since it has to load dynamo first (and if dynamo needs to check for updates or do other startup tasks that is also added to the script execution time)

You can specify whether to use a clean dynamo engine or keep it in memory for the next executions. Set the option below in your bundle file.

engine:
  clean: false

 

If you are going to use python in your development, I recommend abandoning the dynamo editor. In the next topic I will show the main differences between Dynamo Python and PyRevit python (spoiler: slightly different).

Link to the dynamo scripts if you dont have pyrevitDev tools

 

Post Comments(0)