When running a new script, the previous elements are removed. Please advise.
Hi!, are you running your code through Dynamo Player?
This sounds like Element Binding.
Sometimes it works, but sometimes it doesn’t. If I open Revit and use Dynamo Player directly, it works. But if I open and run Dynamo first, then close it and use Dynamo Player afterward, it doesn’t work.
Yep bindings made in dynamo remain in dynamo player. You either need to flush bindings using a utility for it, use python nodes that dont cause binding or replace the binding related nodes.
I’ve said it once, I’ll say it again. For every case where I say yay element bindings, there is hundreds where it doesn’t feel intuitive.
The rhino inside team has a neat solution for this where you can right click and tell nodes not to bind if they create elements.
Would be great to see something of this nature in Dynamo, or better yet, only bind when users say to (yes I know, there would be flip side consequences, but bindings are evidently confusing for most users, feels like unintuitive UX). Maybe a ‘keep bindings’ script option that you activate to preserve bindings on closing a dyn.