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

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?

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

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.

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.

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.

1 Like

also discussed here: Running Dynamo and keeping objects created

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

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.

Can you share your graph?

curtain_wall.dyn (515.1 KB)

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.

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.

@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/

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

Detach Revit Output from Dynamo Graph