Hi Konrad.
I hope all is well with you.
Just checking the old post regarding the renaming of Line Styles, File Patterns, and I have been trying to achieve that for more than a year, as I am not on this full time, and I need help again.
I have loaded the routine I made based on the old post, as well as a Revit Project to help things out.
I am not using the renaming through Excel and I do not think this has any impact on the issue I am having.
To conclude, there is something not quite working once I connect the data into the last Python node, that should rename the Line Styles as per your post. Could you please help me out with that?
Here are a few images related to this post:
Dynamo Version
Revit Version
Dynamo Routine
Dynamo Routine Applied
Python Script 1 - 3
Python Script 1
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
Import ToDSType(bool) extension method
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
Import DocumentManager and TrasactionManager
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
Import RevitAPI
clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
GraphicsStyleType.Projection =
for i in IN[0]:
GraphicsStyleType.Projection.append(UnwrapElement(i))
values = IN[1]
TransactionManager.Instance.EnsureInTransaction(doc)
for i, j in zip(GraphicsStyleType.Projection, values):
i.Name = j
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = GraphicsStyleType.Projection
Python Script 2
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
Import DocumentManager and TrasactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
GraphicsStyleType =
for i in IN[0]:
GraphicsStyleType.append(UnwrapElement(i))
values = IN[1]
TransactionManager.Instance.EnsureInTransaction(doc)
for i, j in zip(GraphicsStyleType, values):
i.Name = j
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = GraphicsStyleType.Projection
Python Script 3
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
Import DocumentManager and TrasactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
graphStyle =
for i in IN[0]:
graphStyle.append(UnwrapElement(i))
values = IN[1]
TransactionManager.Instance.EnsureInTransaction(doc)
for i, j in zip(graphStyle, values):
i.Name = j
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = graphStyle
PM_Line Styles Rename.dyn (38.7 KB)