I have a script that creates some lines and text in Civil3D based on pulling a polygon from civil3D into Dynamo from the Current Layer.
After running it (successfully), I change the Current Layer in Civil3D to run the script again on a different polygon, to create more lines and text related to that polygon. Dynamo correctly gets the new polygon from the new Current Layer … but Dynamo wants to replace the text and lines created from the first run, instead of making new text and line objects.
This happens even if I close dynamo between runs, or if I run it through Dynamo Player, and even if I close both Dynamo and the drawing and re-open between runs.
The objects are created on new layers for each run with names based on the name of the Current Layer. The ‘hold’ dynamo has on these objects is so strong that after the first run, if I lock the layers in Civil3D holding the new features from that run, when I run the script on a new Current Layer, the script fails with warnings that a layer (which is not being called by my script in this run) is locked.
How can I break this hold that Dynamo has on the objects it’s creating in Civil3D?
For context. My script generates a coordinate grid and grid labels for plan drawings in Civil3D. The polygon (in modelspace) is based on the Viewport that will be gridded. Some drawing files have more than one viewport that needs to be gridded, hence the need to run it more than once, and not all together as one run of the script.