Hi everyone!!
I use Pyrevit to run dynamo script but in the first time is slow, seem like dynamo run background first.
Can be run Backgound dynamo when I open Revit.
Hi everyone!!
I use Pyrevit to run dynamo script but in the first time is slow, seem like dynamo run background first.
Can be run Backgound dynamo when I open Revit.
Any software (PyRevit and Revit add-ins included) needs to open and load the various libraries which it utilizes prior to execution. Dynamo is no exception. The delay you are seeing is likely Dynamo attaching those DLLs to the Revit interface. While you might be able to do this at startup (the way other Revit add-ins, including PyRevit do) youâd stuffer a few issues as a result.
As a result of items 1, 2, and 3 youâll spend more time than youâd save by a fair bit. Simplifying your Dynamo environment to reduce the external packages so there are less libraries to load, and reducing Python scripts to only load API classes you need is likely a better investment.
yes I am rebuilding all my dynamo script to python script now so much to learn, totally two different world.
Cheer!! Thank you!
But I realized delay only the first time I run script from button Pyrevit. In the next time not delay (I think maybe in the first time Dynamo not yet run in background so if when run Revit and Dynamo also run in background maybe solved)
Not sure about PyRevit but you can do so with NonicaTab. You only need to select the option âExecute if open Revit fileâ and the selected script (or one emptyâŚ) would load Dynamo at that time.
Hope this helps.
Revit loads the DLLs into the environment at first launch; once they are there they persist until you close Revit. So including Gavinâs recommendation, your options are:
from Autodesk.Revit.DB import *
) since youâre almost entirely just pulling Revit DLLs it may in fact be orders of magnitude faster. But if/when you get to interaction with outside libraries at scale you will likely start to see a similar delay.