Duplicate and rename views


Hi guys!

I have made this script, witch works just fine. I want to be able to duplicate and rename views in sets with different names. I created code blocks that I can use. When I run the script the first time, all is fine, but when I want to run it again, it does not duplicate the view, but only renaming the views I just created.

I also have problem with refreshing the selection node…

Any ideas?



This is normal Dynamo behavior.

On the first run your graph is duplicating the views and renaming them. On the subsequent runs the graph is only updating the data and the only updates you’ve made are to the names, so the views get renamed.

You need to use the refresh boolean on your selection node in order to update your selection. Your best option is to use Dynamo Player if you can. Player runs a new instance of the graph every time and therefore keeps all changes.


Ok, make sense! Thanks! Is there a way to refresh without using the player? Have bad experience with this.


Dynamo tries to save memory by only updating nodes that have changes between runs. The refresh input on the selection node requires a boolean input. Changing the boolean (the actual value doesn’t matter) causes the node to update and rerun. However I’m not sure if it will also keep the changes you’ve made to the new views.

To commit your Dynamo changes to Revit between runs you need to use Python. Dynamo is built to update and allow changes as you build your graph but changes with Python get committed to the Revit document.


You could also just run the script in Dynamo player instead. :slight_smile:


Have bad experience with Dynamo player. It messed up some of my nodes.


try to disconnect the 1st 2 connectors in the workflow and reconnecting them, you can put a watch node after the collector node in the graph and disconnect the link between it and the collector for easier and faster results


Can you send me the messed up version and screenshots of the issue?


Sorry I dont. I have an idea, that it is something to do with the versions. I use Dynamo 0.9.1. Suddenly - after installing the Player, some of my nodes where missing in the project browser and in my scripts.


Yep that’s entirely a version issue not a Dynamo player issue.

You should consider an across the board update as you’re missing out on a ton of good stuff (levels, Dynamo player, and the like). Repathing custom node and package libraries isn’t too hard and you will save tons of time in the end.


Ok, but by opgrading I am a bit worry. It took me a ton of time to develop my scripts, that I use in my work every day. And I dont want to recreate them all. What would the consequence be if I do it?


Worst case? You have to spend a minute or two on some graphs replacing a few custom nodes with updated versions. It sucks but it’s an opportunity to review your old work and streamline it some now that you know more than you previously had written.

Better question is what is the consequence if you don’t update? Well, considering development isn’t stopping, you miss out on all the great new stuff: increased performance, new custom nodes which do things you currently do by hand or with significant difficulty programmatically, and the like. Basically you’re handcuffing yourself to the features you have now but no more as a result of stopping updates. Trust me the new features will be worth it.

Also, when you install the newer Revit versions you’ll be installing a new Dynamo version anyway, and I’d guess that you’d like to have the tools you use in your current version working on the new version anyway. Best to get that up and running before you need it in a real project.