Line Styles deleted by Dynamo still in project

I’ve been spending today building a script that check which line styles are used in the model, checking both the lines and filled region boundaries in order to determine this. I’ve also filtered out line styles with a negative Id, as I know they are undeletable.

I have tried deleting them using the following methods:

  • OOTB delete node
  • My Crumple nodes that use del.Id
  • Spring nodes
  • Archilab

Despite my better efforts, the line style ‘sticks around’ in the project, although it is not an option in the dropdown for new lines and its settings are wiped, see below, the ‘Unused 1/2’ styles are the deletion candidates in this case, the rest is filtered out prior:

Pretty much every topic I found about deleting line styles had people questioning why this happens, and no-one seemed to address/answer with a solution (in most cases it appeared people were just looking at the deletion outcome in Dynamo, and not the outcome in the project with their provided solutions, which overall doesn’t lead to a full solution in my eyes).

Has anyone got any insight as to why this is happening, and also if there is a better way to delete them which does not lead to this outcome?

Sorry if I sound a bit disgruntled, been trying to crack this for about an hour without much luck!

1 Like

Yes very strange, the same here :wink:

1 Like

When i try to delete linestyles, its just set all the colors to black !

This one here should work


How are you checking which line styles are unused? Those pesky styles in a family with no instances might not be caught as one thought. There is also lines applied to a object style which no objects, and the like.


Correct me if I’m mistaken, but aren’t lines in families associated to object styles and line patterns? From my understand line styles only appear in detail/model lines, region borders (masking/filled) and line overrides (which I usually recommend against). Nodes will be in crumple soon for these steps, but until then sharing the script wouldn’t help anyone given they’re in RnD phase.

I’m assessing the line style of all lines in the model, and the line of each fill border (edge curve in the API) and running it against the model styles. Delete the unmatched.

In this case even just trying to delete an entirely new style specifically causes this issue, so I’m seeking a solution to that. I will try steamnodes eraser and report my findings. Thanks for the suggestion.

1 Like

Gavin…dont think you need steamnodes or list clean, just a ootb delete…i just do it because i was sitting and playing…:wink:

Do the styles you want to delete show up in the purge unused list?

Line styles aren’t a purge candidate. I’ll check the element I’m returning as I suspect maybe I’m getting the graphic style versus the actual line style itself. The ‘subcategory’ from genius loci makes me think it’s a different element to target for the actual deletion element.

Doh! I am getting it backwards as well… what I get for responding from my phone instead of doing some legwork.


No worries, almost solved it, and will credit the solution to sovitek once I’ve done so!


Cheers Gavin…but think the credit should go to Alban and his amazing package :wink:



Well done Søren ! You discovered that the correct method to purge line styles was to use subcategories and not GraphicStyles.


Thanks Soren, and also Alban for helping me understand this - makes sense now.

‘If I have seen further, it is by standing on the shoulders of giants’ :wink: