Detailcomponent gets deleted after second run of script

Hey all,

I have been working on a script to place a detailcomponent that indicates were the rebar is located. If I run the script a second time it deletes the previously created element and only places the new one. I had really hoped that with using the player this problem would have been resolved. I understand this might have to do with some element binding.

I have seen a couple post that might relate to this problem, but I have read that the solution could be different in each case…

Hope you guys can help me out a bit.
I have none to almost none experience with Python yet.

Below a picture of my Revit file:

Detailcomponent should be in both view but is only in the last view the script is run on. (the left in this case)

Below a picture of part of my script:

Posts I have found/read for now:

The last link you posted will explain things most completely (though I may be biased).

Save the Dynamo file, close Dynamo, open the Dynamo file in text editor, search the file for “binding” and delete all the stuff in the binding section of the file. Reopen Dynamo player and run the graph that way going forward.

Thank you for the fast response Jacob :smiley: ,

Was a little bit afraid that would be the solution to this.
I’ll try this and will post it in this tread if I got it to work.

You could also remove the bindings by causing a ‘null’ to pass into all element creation nodes, then save, close, and move onto a Player focused environment. However I have found that often people ‘miss’ one of the creation bits and it keeps a binding (or two, or ten) in the file, causing an even more confusing behavior.

I have no clue why, but I have not changed a thing yet in my script. But it keeps the element that it creates now… I guess turning my computer off and on is the only thing I did and it helped?

Will start reading more about the element binding in case it does start replacing the element again!

1 Like