How to create Revit elements and keep them in the model?

Hi guys,

A really basic question but I cant figure it out.

Supposingly we have a script which creates rebar in our beams.

Selecting one, hitting run, and we have our rebar made. But using the same script, and just switching to another beam, dynamo removes the first rebar and moves the execution of a script into the next one.

Is there some kind of node to keep the previous runs saved in the model? Anyone please could explain why this happens? :slight_smile:

 

The only way I’ve found to do that quickly is to re-open the DYN that I just ran. It’s easy enough to script something in AutoHotKey to map that action to a single hotkey. 2016-03-24 20_23_02-Dynamo

it happens because dynamo stores the element id of the elements that it creates and then always tries to UPDATE them first rather than creating new ones. Now imagine if it wasn’t doing that and instead was always adding new elements to the mode. you would be getting a lot of duplicates on top of each other and eventually the whole thing would come down, crash and burn. Now, we have requested a feature from Dynamo team that would allow you to BAKE - if I may use grasshopper terminology - elements into the model, so that they remain in the model and it doesnt try to update their position but rather creates a new set on next run. That feature is much needed but has not been implemented into the Dynamo core yet, and I can’t tell you when it will be implemented. Now, one thing that i usually do is design my definitions to work on multiple elements all at once so I don’t run the same script over multiple things. for that you would have to break the association by basically deleting the nodes, and then replacing them with new ones. It’s actually pretty tricky to detach them for this purpose.

3 Likes

Thanks guys,

Well, I’ll try to redefine my scripts to do all the operations instead of reopening each time, though it will be challenging :slight_smile: