# Deleted elements due to new script

**URL:** <https://forum.dynamobim.com/t/deleted-elements-due-to-new-script/109633>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [April 22, 2025, 4:25pm UTC](https://forum.dynamobim.com/t/deleted-elements-due-to-new-script/109633 "2025-04-22T16:25:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VijayS](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@VijayS](https://forum.dynamobim.com/u/VijayS)\
**Post date:** [April 22, 2025, 4:25pm UTC](https://forum.dynamobim.com/t/deleted-elements-due-to-new-script/109633/1 "2025-04-22T16:25:40Z")

</div>

When running a new script, the previous elements are removed. Please advise.

 ![2025-04-22_21h54_44](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/f/7fec279d201a0af54e2cd028fb073df3d69af1fb.png)  
 ![2025-04-22_21h55_00](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/b/fb099305251a9fbecff823466f321ef30c597d2b.png)

---

<div class="post-metadata">

**Author:** ![Urabe](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/urabe/32/198763_2.png) [@Urabe](https://forum.dynamobim.com/u/Urabe)\
**Post date:** [April 22, 2025, 4:49pm UTC](https://forum.dynamobim.com/t/deleted-elements-due-to-new-script/109633/2 "2025-04-22T16:49:44Z")

</div>

Hi!, are you running your code through Dynamo Player?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 22, 2025, 4:59pm UTC](https://forum.dynamobim.com/t/deleted-elements-due-to-new-script/109633/3 "2025-04-22T16:59:12Z")

</div>

This sounds like [Element Binding](https://forum.dynamobim.com/t/element-binding-in-revit/31612).

---

<div class="post-metadata">

**Author:** ![VijayS](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@VijayS](https://forum.dynamobim.com/u/VijayS)\
**Post date:** [April 23, 2025, 9:36am UTC](https://forum.dynamobim.com/t/deleted-elements-due-to-new-script/109633/4 "2025-04-23T09:36:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [April 23, 2025, 10:54am UTC](https://forum.dynamobim.com/t/deleted-elements-due-to-new-script/109633/5 "2025-04-23T10:54:35Z")

</div>

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.

 ![9rnz1l](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/4/646a57efe13e4521f0d66d684ddee9bbde2a8578.jpeg)
