Using Dynamo to Select Lines with Specific Style in Revit ? (Question)

I have a question that I hope you can help me with. I am currently cleaning up a Revit model that includes imported CAD files. Specifically, I am trying to find a way to select all the lines that have been drawn with the “hatch22 - Continuous” style in my project using Dynamo.

This is because it’s becoming increasingly difficult and time-consuming to look for these lines in every view manually. If anyone has any suggestions or solutions to this problem, I would greatly appreciate it


I was experimenting with all of these nodes.

If you’re only checking for one line style, you can probably just go with an equals comparison filterbymask based on the string output “hatch22 - Continuous”, or you can use the element ID # since you already pulled the full list of GraphicsStyles.

1 Like

Thank you so much Robert for you help, bright way
but I still have an error in the element name !

Parameters are case-sensitive.

[S]tyle de Ligne

1 Like

OH MY BAD THANK YOU, now everything works perfectly but when I try to run in revit no line is selected :confused :confused:

The nodes I’ve screenshotted do not select elements in the Revit environment, it’s just giving you the list of elements in the project that are relevant. If you want to select all the lines within the Revit environment, you’ll want to use something like the Springs package.

Depending on what you’re actually trying to do once you’ve collected all the detail lines, you might be able to just do all of the work in the Dynamo environment without bouncing back and forth between Revit and Dynamo. For instance, using just Dynamo you would be able to do things like:

  • Delete all the chosen elements
  • Change all of the chosen lines to a different linetype
  • Override the V/G settings in a chosen view for that selection
  • Change other parameters that those line elements contain

The Springs package should work just fine if you’re only looking a few dozen/few hundred line selections. If you get into the thousands in a larger file, you might experience some slowdown.

If you want, you can describe a bit more of your intention and workflow with this script. Someone can chime in with a few pros/cons and possibly suggest alternate options.

1 Like

Thank You so much Robert for your help, I used the node delete item, and it works perfectly for me. Thank you again for your help