from pyrevit.framework import List
from pyrevit import DB, revit
doc = revit.doc
#Create list of segments which define the line pattern
lstSegments = List[DB.LinePatternSegment]()
lstSegments.Add(DB.LinePatternSegment(DB.LinePatternSegmentType.Dot, 0.0))
lstSegments.Add(DB.LinePatternSegment(DB.LinePatternSegmentType.Space, 0.02))
lstSegments.Add(DB.LinePatternSegment(DB.LinePatternSegmentType.Dash, 0.03))
lstSegments.Add(DB.LinePatternSegment(DB.LinePatternSegmentType.Space, 0.02))
linePattern = DB.LinePattern('Name of the pattern')
linePattern.SetSegments(lstSegments)
#Create a linepattern element
with revit.Transaction('Create line pattern'):
linePatternElement = DB.LinePatternElement.Create(doc, linePattern)
While creating a fill pattern was easy, I´m now struggling to get the fill pattern id.
I need the Id to use this pattern for graphic overrides for view filters. A fill pattern has no Id, only a fill pattern element has an Id. So what do I have to do?