Hi All,
I have followed all other advise and can not work out why I can not access a walls name by using Element.Name- I get an AttributeError:Name
In the script below, I am simply passing in a Categories Node: Walls. I can successful output the walls before the for loop starts, but the error happens when I try and call name.
Common Language Runtime module
import clr
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitServices’)Revit and Dynamo module
from Autodesk.Revit.DB import FilteredElementCollector, Family
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManagerdoc = DocumentManager.Instance.CurrentDBDocument
collector = FilteredElementCollector(doc)
Option 02, pass them in from dynamo (ensure you unwrap them before using them)
category_input = UnwrapElement(IN[0])
collected_walls = collector.OfCategoryId(category_input.Id).ToElements()
argument assigned the IN port
rename = IN[1]
core data processing
type_name =
TransactionManager.Instance.EnsureInTransaction(doc)
for element in collected_walls:
for idx, searched in enumerate(collected_walls):
if searched == element.Name:
element.Name = rename[idx]
type_name.append(element.Name)
TransactionManager.Instance.ForceCloseTransaction()return assigned the OUT port
OUT = collected_walls