Line Patterns get deleted when running script multiple times

I’m having an issue with a scrip I’m working on. I have multiple sections of it that I freeze when I don’t want them to run. The script includes these groups that I freeze depending on what I want to do:

  1. Delete Line Patterns that don’t include “zz-”
  2. Append “zz-” to existing line patterns
  3. Add Line patterns from an excel sheet.
  4. Delete Line styles that contain certain strings
  5. Create lines styles using line patterns created above
  6. Create text notes with the line pattern name
  7. Create lines with line styles created above (not complete)

Number 7 is not complete because I noticed that line patterns generated by number 3 keep getting removed for some reason. This is my work flow.

Every group has certain input nodes freezing the rest of the group. I unfreeze 3 and run the script. Freeze 3. Unfreeze 5 and run the script. Freeze 5. At this point the line patterns and style are set up correctly. At this point I would unfreeze 6 and 7 to run that portion. After running them the line patterns are gone.

I’ve also tried this with 6 and 7 frozen. Same issue. Am I just using Dynamo incorrectly?

Revit Dev - Line Pattern Script V2.dyn (218.6 KB)

This is how Dynamo is supposed to run. You’re essentially telling Dynamo to rerun with new inputs, overwriting what your previously did. You’ll either need to close out of your graph in between runs or use Dynamo player.

1 Like

I was going to try to do 3,5,6, and 7 with one run. It sounds like from what you posted that this would work. Because it is done all in one run sequentially rather than in separate runs, correct?

Correct. You could also look into using multiple transactions to make things run in a certain order.

1 Like

Thanks for the help.