PyRevit and multiple open models problem


When I have 2 or more models open in the same Revit instance I get the following problem.
I use dynamo scripts from the toolbar in Model-A and all works fine.
When I want to use a script in Model-B it won’t work.
A fix I found is when I open and close dynamo in Model-B I can use scripts again in Model-B.
But now I can’t use scripts in Model-A anymore.
This is not a very big problem for me, but a lot of my colleagues use my scripts and most of them don’t know why the scripts are not working.

1 Like

@MelleH Welcome

Have a look at bundles
In the dynamo script section and try to work with engine keyword in your bundle file

There are two modes


Thanks this worked!
But it does make everything work a lot slower :frowning:
I gues there is nothing to do about it because you restart dynamo each time to make it work…

The only thing that could improve loading time of dynamo would be to reduce the number of custom packages to the bare minimum.
Or transform the script to python :stuck_out_tongue:

1 Like

Well am trying to get in to coding in python for revit using PyRevit.
I have finished multiple python courses so i know about the basics.
But i am having a hard time getting started.
Do you have any suggestions?

  • start small, small functions that do not involve extensive Revit api knowledge: maybe a button that does copy data from a parameter to another one for a set of elements, for example
  • plenty of ways to start, but to start, you need to make things
  • read the docs for pyrevit, the revit API, pyrevit code docs,
  • look at pyrevit code base and buttons and read and try to understand them
  • I put some ressources on my github page jmcouffin (Jean-Marc Couffin) · GitHub
  • also an intro presentation I did last year could help you: GitHub - jmcouffin/pyRevit-BILT_NA_2022

  • and again, start small
  • make it
  • read the docs

you won’t regret it

1 Like