Does python script have holes in it or do I need an import somewhere (that I amy be missing - am new to dynamo/python) I have a python code script I am trying to adapt from here: <span style=“color: #75715e;”>http://help.autodesk.com/view/RVT/2014/ENU/?guid=GUID-E7B451BB-21DC-4D72-AD26-75F0C2E911E4</span> It Bombs out at line 23 “<span style=“font-weight: bold; color: #f92672;”>for</span> objFace <span style=“font-weight: bold; color: #f92672;”>in</span> objRoomSolid.faces:”
Script as follows using mongolian-type notations-Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File "", line 23, in
AttributeError: 'Solid' object has no attribute 'faces'
##Started partial translation from help in the API :
## Help
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import*
import Autodesk
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
items = UnwrapElement(IN[0])
listElements = list()
for objRoom in items:
objDoc = objRoom.Document
calculator = SpatialElementGeometryCalculator(objDoc)###
objResults = calculator.CalculateSpatialElementGeometry(objRoom)
objRoomSolid = objResults.GetGeometry();
for objFace in objRoomSolid.faces:
FaceArea = objFace.area
## get the sub-faces for the face of the room
subfaceList = objResults.GetBoundaryFaceInfo(objFace)
for objRoomSolidFace in objRoomSolid.Faces:
for objsubface in objResults.GetBoundaryFaceInfo(objRoomSolidFace):
objBoundingElementface = ocjSubface.GetBoundingElementFace()
objEid = objBoundingElementface.MaterialElementId
listElements.append( doc.GetElement(objEid).Name +“, id = “+ objEid.IntegerValue.ToString()+”\n”)
#
OUT =(listelements)