I'm creating new line styles in Revit MEP 2013 through the API in VB.Net, and I've almost got everything figured out... except setting the line pattern. There doesn't seem to be a way to do this one, last step. Any ideas?
Here's what I have so far:
PublicFunction LoadStyle(ByVal n AsInteger) AsBoolean
Dim lineCat As Categories = m_RvtDoc.Settings.Categories
ForEach objCategory As Category In lineCat
If objCategory.Name = "Lines"Then
If objCategory.CanAddSubcategory = TrueThen
Dim cat As Category = lineCat.NewSubcategory(objCategory, MEP(n, 6))
If MEP(n, 7) <> ""Then
Dim r, g, b AsInteger
r = MEP(n, 7)
g = MEP(n, 8)
b = MEP(n, 9)
Dim c As Autodesk.Revit.DB.Color = New Autodesk.Revit.DB.Color(r, g, b)
cat.LineColor = c
If MEP(n, 11) <> ""Then
CInt(MEP(n, 11)), GraphicsStyleType.Projection)
'set line pattern
If MEP(n, 10) <> ""Then
'cat.LinePatternId = GetElementByName(GetType(LinePatternElement), MEP(n, 10))
"Line style " & MEP(n, 6) & " already exists.", MsgBoxStyle.Information, "Load Systems Error")
"Can't add line style.")
Thanks for the response, Joe. Would it be possible to check to see if it's exposed in Revit 2014? And are there any workarounds? This is very important for my project.
Interface Engineering, Inc.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.