Hello,
help please, I put most of my dynamo script as a bundle in my tab, with icons, grouping hierarchy, use of Quick Access Toolbar, etc. All work great and is beautiful work without using the Dynamo Player…
… but only with one document open, with mode than one and switching to the new the scripts continue to work always on the first.
I made some test script to get the current document name and is always the same.
Same problem with the family editor too.
All my scripts works well from the Dynamo player without problem.
Any hints on where I’m wrong
Hi Dario,
Never had that problem. Could you send a pushbutton folder containing script and bundle for me to try?
I have my own toolbar and use quite a few other pyrevit toolbar and never had that issue.
I’m having similar issue as well. I have 5 Revit documents opened. Whenever I run a Dynamo script from the custom tab via pyRevit, it only applies on the first model. It seems like it can’t identify my current Revit document. Is there additional config I can use to make sure the script is applied for the current document?
There is a set of possible options for the bundle.yaml file that clears the engine. It is documented in the wiki on notion if you look for dynamo and bundle.
You could also try to get the active document in dynamo, using the HOST_APP.DOCS then make a document selector by name.
This might be a silly question but in which bundle.yaml file should I include the engine keyword? I tried it with the.yaml file inside the pushbutton folder but it doesn’t seem to work
title: |-
Object ID
General
tooltip: |
Generate running numbers for CSD elements
Supported categories:
1. Cable Trays
2. Ducts
3. Pipes
engine:
clean: false
Sorry, I try more than a year ago, remember that work but the time to reload everything again was to much.
So now i use a different approach. Quick tools on the ribbon and pay attention to have one document open, all the tools that normally work on multiple document, like operations inside the family editor, on the Dynamo Player that have a better handling of multiple scripts in the lastest versions.
i made a “Reload Dynamo Engine” button that has this yaml flag. the dynamo script itself was simply a dialog box that says “Dynamo Engine Reloaded” or similar. Just run that button every time you switch documents and then you are good to go. no need to reload for every button