Get Detail Line Line Pattern


Hi all,

I am trying to get the the Line Pattern set to a Line in the Line Styles menu (sorry for the confusion). The Line Pattern set to Detail Lines. I found the API link below and wrote this simple code but I just get null as the return. Any ideas? I am guessing I do not have the right API section.

import clr
import math

import Autodesk
from Autodesk.Revit.DB import *

import Revit

from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

EleId = UnwrapElement(IN[0])
element = []
for i in EleId:
	OUT = element.append(i)



This will be of interest for you: LinePatternElement names


Unfortunately that is not have C# solutions work, you need to create the entire solution in C# and compile the project in order to create the node. More info can be found in the Dynamo Primer:


Oke Thanks. Going to study on that to see how far i can come. I will take my time :slight_smile:


Thanks for the link @Jonathan.Olesen,

Unfortunately I was unsuccessful at putting something together. In the Link you provided Gopinath says there is no way to get the Line Pattern (back in 2014). I have culled through the API and Have not found anything else other than what I posted above. Unless anyone else has an Idea I think we will just have to wait for Autodesk to add something.


@Steven its possible, you have to get the graphics style element from the curve using the LineStyle property. With the GraphicsStyle, get the category and type properties, and use those with the GetLinePatternId method

import clr
from Autodesk.Revit.DB import *

import Revit

import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

curves = IN[0]
if not isinstance(curves,list):
	curves = [curves]
patterns = []
for curve in curves:
	curve = UnwrapElement(curve)
	gscat = curve.LineStyle.GraphicsStyleCategory
	gstype = curve.LineStyle.GraphicsStyleType

OUT = patterns

PS it appears solid returns null


Just a follow-up on the “Solid”. :slight_smile:

The “solid” is special and is not really a line pattern (even tough it looks that way). It can however be set using:
“ProjectionLinePatternId” of the “OverrideGraphicSettings” of a category the Id of the Solid “pattern” is: -3000010

It is stated under “Remarks” here: