# Delete all "Detail Lines" with a specific "Line Style" parameter" - How?

**URL:** <https://forum.dynamobim.com/t/delete-all-detail-lines-with-a-specific-line-style-parameter-how/951>\
**Category:** Packages\
**Created:** [January 21, 2015, 2:57pm UTC](https://forum.dynamobim.com/t/delete-all-detail-lines-with-a-specific-line-style-parameter-how/951 "2015-01-21T14:57:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [January 21, 2015, 5:48pm UTC](https://forum.dynamobim.com/t/delete-all-detail-lines-with-a-specific-line-style-parameter-how/951/3 "2015-01-21T17:48:11Z")

</div>

Daniel,

You were close, or rather on a good path. Here’s how i solved this:

&nbsp;

![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/1X/361d5bfea8ee071e61150501b3852f92ee51303b.png)

Explanation:

You had a good idea to collect all lines using the Category OST\_Lines and then query them for Line Style parameter. What that returns however, is an ElementId object. That’s an Id of a Line Style type that was assigned to the given Detail Line. Now in order to filter out just the ones with a Line Style called (named) “Construction” or in my example 1-Dash you need a few things. First I used a custom Python node to get the Line Style itself and then then queried it for an Id. I am using an [archi-lab](https://forum.dynamobim.com/t/revit-2022-dynamo-2-10-package-not-showing-up-and-icons-missing/62933/7?) ElementId node here since it returns an ElementId object instead of integer object like the standard Element.Id node does in Dynamo. Objective is to use that style Id and compare it to one that we got returned from Element.GetParameterValueByName node (remember I said it returns an ElementId so its important that we have two matching data types if we want to compare them. you cannot compare an integer to ElementId object). Then I am using Equals node to create a list of True/False values that tell me which lines have the desired line style. Use List.FilterByBooleanMask to get only lines that have desired style assigned and then just delete it. I am again using a custom node from [archi-lab](https://forum.dynamobim.com/t/revit-2022-dynamo-2-10-package-not-showing-up-and-icons-missing/62933/7?) package.

You can get the [archi-lab](https://forum.dynamobim.com/t/revit-2022-dynamo-2-10-package-not-showing-up-and-icons-missing/62933/7?) package from the package manager and for that one custom node, the code is below. I will eventually make that into a custom node and add to [archi-lab](https://forum.dynamobim.com/t/revit-2022-dynamo-2-10-package-not-showing-up-and-icons-missing/62933/7?) package so check back in the near future.

> #Copyright(c) 2015, Konrad Sobon # @arch\_laboratory, http://archi-lab.net
> 
> import clr  
> clr.AddReference(‘ProtoGeometry’)  
> from Autodesk.DesignScript.Geometry import \*
> 
> # Import DocumentManager and TransactionManager
> 
> clr.AddReference(“RevitServices”)  
> import RevitServices  
> from RevitServices.Persistence import DocumentManager  
> from RevitServices.Transactions import TransactionManager
> 
> # Import RevitAPI
> 
> clr.AddReference(“RevitAPI”)  
> import Autodesk  
> from Autodesk.Revit.DB import \*
> 
> doc = DocumentManager.Instance.CurrentDBDocument  
> uiapp = DocumentManager.Instance.CurrentUIApplication  
> app = uiapp.Application
> 
> from System.Collections.Generic import \*
> 
> #The inputs to this node will be stored as a list in the IN variable.  
> dataEnteringNode = IN
> 
> name = IN[0]
> 
> lineStyles = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST\_Lines)  
> lStyle =   
> try:  
> lStyle.append(next(i.LineStyle for i in lineStyles if name==i.LineStyle.Name))  
> except StopIteration:  
> pass
> 
> OUT = lStyle[0]
> 
> &nbsp;

---

_[View the full topic](https://forum.dynamobim.com/t/delete-all-detail-lines-with-a-specific-line-style-parameter-how/951)._
