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
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
EleId = UnwrapElement(IN[0])
element = []
for i in EleId:
LinePatternElement.GetLinePattern(doc,i.Id)
OUT = element.append(i)
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: http://dynamoprimer.com/en/10_Packages/10-5_Zero-Touch.html
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
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