Automating the beam modelling by selecting the lines in revit

developed a Dynamo script to automate beam modeling in Revit by selecting the lines I created. The script works as intended for generating beams; however, I observed that when I run the script multiple times with different inputs, the previously created beam elements get overridden.

My objective is to make the Dynamo script retain or “remember” the previously created elements and avoid modifying them during subsequent runs. I understand that this behavior is related to Dynamo’s element binding, and I am exploring approaches such as using Data.Remember, transaction management, or implementing a Python node to control element creation more effectively. See the below snip for 1st run

And here below is the 2nd run, the first created beams were overridden

This is Element Binding behavior and is intended. Review the thread linked for information on how to resolve.

This may be very controversial but if you are physically drawing a line to represent a beam, then you are using a script to model the beam. Why are you not drawing the beam anyway instead of the line?

Asking because it sounds as though you are adding lots of steps in that possibly are not needed. Of course if in the future you will get dynamo to temporarily create the lines to apply to a beam then that’s fine but something to think of.