I am able to access the Name of selected areas using the GetParameterByName Node, however when I try to get it in Python it tells me that the Area doesnt have an attribute of Name
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 65, in
AttributeError: Name
Here is the code:
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
Import RevitNodes
clr.AddReference(“RevitNodes”)
import Revit
Import Revit elements
from Revit.Elements import *
#The inputs to this node will be stored as a list in the IN variables.
Areas = IN[0]
Levels = IN[1]
AreaNames = IN[2]
AreaList = [[] for x in xrange(Areas.Count)]
Counter = 0
OutLevels = []
for i in Areas:
Area = UnwrapElement(i)
AreaList[Counter].append(Area.Name)
Counter = Counter + 1
#Assign your output to the OUT variable.
OUT = AreaList
If I substitute Area.Area for Area.Name it works quite happily, so I am obviously looking for the wrong attribute, but I don’t know which attribute I should be looking for… do you?