Purge Revit "Line Styles"

Wanted to offer this as a possibility for purging “Line Styles” (Not line patterns which I will post later)
PurgeLineStyles-v0.8.dyn (51.3 KB)

In this there are some adapted nodes from Archilab and dconstruct to new purpose.
The inital PY routine:

  • Returns all the line styles in the model (Uses a split in the event it id a “TEXT STYLE : Typename” so input is a little forgiving)
    The second lookup uses the linestyle name to Return:
  • The ID of the line styles
  • The Name of the Line styles
  • Paired list of both (Handy for debugging and tracing)

Code blocks allow selection of the particular sub lists

The Regexp routines compare lists using Regexp to a True/False if the object is in a list or not.

The DEAD CODE below is wht I have issues with - trying to get the object styles so I can build a list of substitutions (Target Line Style (Linestyle1 to replace, Linestyle2 To Replace…)) to strip out the line styles form object and overridden objects in views to limit the impact of getting back to the original NCS/Revit line styles.

Feel free to offer suggestions how this could be implemented : )

Thanks!
Ron

3 Likes

Hi Ron,

Than you very much for your post. I was trying to purge some of our line styles here in the office, based on this routine “Excel Roundtrip - Fill Patterns, Line Styles etc.”
However my routine, made with nodes only, was weirdly “deleting” them in a kind of resetting way. It would leave all line styles I was filtering to be removed/deleted/purged, and it would set all their Line Weights and Line Patterns to blank, as well as set their Line Colors to Black.
It would also state that they were deleted, and they would show up as Empty on a second run. To conclude, it was not working. So, thank you again. and Kudos to you.
Below you will find the routine and the images resultant from it.
Kind regards, Haley

DPULineStylesRemoval.dyn (17.9 KB)