0

How do I get the Name of a WallType in PyRevit? I can get to FamilyName, but it's not what I want, I want the exact name of the wall (e.g., '300mm concrete'). The code I use:

from Autodesk.Revit.DB import *

doc = __revit__.ActiveUIDocument.Document
walls  = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).\
         WhereElementIsElementType().ToElements()

for wall in walls:
    print(wall.Name)
Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166

1 Answers1

1

You cannot get the Name from a WallType because it inherits from ElementType and this class does not include a getter for Name.

What you could do to retrieve the name is accessing the overriden properties of the object as seen in this other question.

Which you can easily adapt to your code as:

from Autodesk.Revit.DB import *

doc = __revit__.ActiveUIDocument.Document
walls  = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).\
         WhereElementIsElementType().ToElements()

for wall in walls:
    print(Element.Name.GetValue(wall))
Shunya
  • 2,344
  • 4
  • 16
  • 28