How can I prevent Dynamo from placing new families at each run?


#1

I’ve have placed several families in the project environment and I’m able to update the families or their locations without any problems as longs as long as I stay in the same session. If I close the script or it loses “connection” which sometimes happens when you open a new family, family template or project file and return to the project where dynamo was pointed too in the first place, Dynamo will place new families over the already existing families when I run the same script. This means that i’m unable to update anything in the project environment without first having to delete all placed families before I run the script.

How can I prevent Dynamo from placing new families over the already existing families?


#2

That’s really dependent on how you’re placing them currently.


#3

In this recent project, I have adaptive component panels placed on a points generated in Dynamo. I have walls created based on curves in Dynamo. I have roofs also created trough curves either selected in Revit or created in Dynamo. And I have several line based families. The first time I placed the families, everything went as expected. As soon as I closed that Dynamo session and reopen it and rerun the script, it places new family instances. If i’m not mistaken, new roof instances are not placed if there is an existing floor which was placed previously by Dynamo in a different session.


#4

This is expected behavior. Dynamo runs every node from scratch each time you open the file. Using some list management to drop the entire dataset early in the graph before closing, then undoing in Revit should keep the Revit work, and make it so you don’t re-create the stuff you just made the next time you open the file.


#5

I would actually say this is not expected behavior, element rebinding should work when opening a dynamo file you have saved (thats why we save giant amounts of element binding data into the dyn file)

so if it’s not working please report a bug.


#6

also discussed here: Running Dynamo and keeping objects created


#7

So basically Dynamo should not recreate elements when the file is opened and rerun. If it does, it’s probably a bug, right?


#8

yes, though there are types that Dynamo cannot reassociate because the revit API has no facility to update them, I think import instances are one of those cases. I know there are also some issues with nested custom nodes.


#9

Can you share your graph?


#10

curtain_wall.dyn (515.1 KB)


#11

I had a similar issue with adaptive components in an AC family sometime ago. Every time I ran the script, new adaptive components where added.


#12

It would definitely be nice to be able to turn this on and off in dynamo, but you can also try running with Dynamo Player.
I recently used the player to repeatedly place stuff in a model on different levels and the previous runs where not undone.


#13

@Joseph_Peel I found this to be the case as well - Dynamo player was the way to go without closing and reopening Dynamo after each run/


#14

You can also use dummy transactions as showcased by @Paolo_Emilio_Serra1 at the following link:

Detach Revit Output from Dynamo Graph