Script deleting previously placed tags

Hi, I have a script that from the outside appears to be working, however after I run it the first time to place my tags, and then toggle the boolean switch to initiate a new iteration, and then press run again, it still places the tags on the new items, however, it keeps deleting the previously placed tags. What gives? why is it doing that? and how do I make it stop? thanks
![image|690x348]![image|690x498]


This is because dynamo is built to allow for each “run” to replace created elements with each successive run - this is ideal for most uses as you wouldn’t want 70000 different geometry instances created as you tweak a graph to check stair headroom as one instance.

There are several solutions noted in the forums, including:

  1. Use python scripts with additional code to remove the link between dynamo and the created elements.
  2. Close the dynamo graph between runs.
  3. Execute the scripts via dynamo player.

#3 is my personal preference.

1 Like

Well, I figured out #2 by myself but that is tedious. #3 is not possible because I am in revit 2016. Can you shoe me how to do #1 please? thanks

Tied up at the moment with some other work. This post has several good sources for reverse engineering this yourself.

https://forum.dynamobim.com/t/dynamo-created-elements-disappearing-after-second-run/?source_topic_id=14129
1 Like

@JacobSmall
Ok so I read all of that including the linked posts but I dont see how that would work for me. I am not that good at python to change a python node from adding a beam on a curve to breaking the dynamo link to the previously generated elements. I think maybe this code block has what I need but I dont understand it. It looks like he is deleting everything and that is the opposite of what I want.

image

Ok, so…where we left off on this topic I said that dynamo was deleting previously tagged elements tags even though I was toggling the refresh button ont he springs.collector.currentselection node each time I hit run. And @JacobSmall said that it had to do that, however, when I use the same node to do different functions, it does not delete the previous functions, for example, when I copy two parameter values to an entire run of conduit, I can just go from conduit run to conduit run, selecting the new source elements for my parameter values, toggle the refresh button, select the new conduit run, and press run, and vwolla, no problems. But when I do it with tags there is a problem. I have to close dynamo everytime, and sometimes that doesnt even work. What is going on? Thanks

Changing parameter values doesn’t create new element Ids so there isn’t anything to delete. :wink: