Hello everyone,
I am having errors with an script that should export to Excel the name of all the Piping System Types in a Project without elements, but where the Piping System Types were defined in the Revit Template.
The script that I am using is
import clr
clr.AddReference('RevitAPI')
import Autodesk.Revit.DB as DB
import xlsxwriter
doc = __revit__.ActiveUIDocument.Document
# Get all PipingSystemType elements
piping_system_types = DB.FilteredElementCollector(doc).OfCategory(DB.BuiltInCategory.OST_PipingSystem).ToElements()
# Create Excel workbook and worksheet
workbook = xlsxwriter.Workbook('PipingSystemTypes.xlsx')
worksheet = workbook.add_worksheet()
# Write headers
worksheet.write('A1', 'Piping System Type Name')
# Write PipingSystemType names to Excel
row = 1
for piping_system_type in piping_system_types:
print (piping_system_type.Id)
worksheet.write(row, 0, piping_system_type.Name)
row += 1
workbook.close()
And it gives an error for piping_system_type.Name
that says AttributeError: Name
When I explore the Id number in the Revit LookUp, I see that the attribute Name is declared twice, and I do not know how to access the one I need.
What I am doing wrong?