Hello, I’m new to Revit API
I’m trying to access to Wall.Geometry.Triangulate() to get a mesh of a wall. The walls do not seem to be Autodesk.Revit.DB.Wall, and seems like UnwrapElement(wall) returns an Autodesk.Revit.DB.Wall.
But, when I get wall.Geometry, it doens’t return a Autodesk.Revit.DB.Solid (which has Triangualte()) but IronPython.Runtime.Types.ReflectedIndexer instead.
Can anybody help me out to get an Autodesk.Revit.DB.Solid out of a wall type element?
Thanks.
walls = IN[0]
aa=
for wall in walls:
ss=UnwrapElement(wall)
aa.append((ss.Geometry))
#Assign your output to the OUT variable
OUT = aa

Hi @masaaki.mikI and welcome!
Try get_Geometry() instead?!
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
input = UnwrapElement(IN[0])
output = []
opt = Options()
opt.ComputeReferences = True
opt.IncludeNonVisibleObjects = True
opt.View = doc.ActiveView
#input is NOT a list atm, a single input!
for obj in input.get_Geometry(opt):
if "Autodesk.Revit.DB.Solid" in str(obj):
output.append(obj)
OUT = output

3 Likes
yw! please mark the topic as solved.