in reference to http://dynamobim.org/forums/topic/excel-roundtrip-fill-patterns-line-styles-etc/ I tried to apply the concept to Line Styles names without going through the excel part.
all seems fine until I try the apply the code from @Konrad_K_Sobon. Maybe it is because it is from 2015 and some things have changed in the API
Basically if I keep the code intact I get “unexpected token ‘import’”
and if I remove some of the dependencies I get " the element does not support user specified name "
any clue as to what I am doing wrong would be appreciated:
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManagerfrom System.Collections.Generic import *
clr.AddReferences(“RevitAPI”)
import Autodesk
import Autodesk.Revit.DB import *doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.ApplicationdataEnteringNode = IN
fillPatElems =
for i in IN[0]:
fillPatElems.append(UnwrapElement(i))
values = IN[1]TransactionManager.Instance.EnsureInTransaction(doc)
for i,j in zip(fillPatElems, values):
i.Name = j
TransactionManager.Instance.TransactionTaskDone()OUT = fillPatElems