Doing the standard “element geometry” gives me nothing. Baking the graphical element itself into the rhino model isn’t a possibility. I’ve tried so many things, alongside with elements parts geometry, Element Location, Element Dependents, even tried adding an analyitcal element to it and NOTHING worked. I’d be satisifed with even just the boundary lines, or the boundary points too.
the Element View Geometry has a warning “The object reference was not set to an object instance” and the Element Preview one has no warning, but the outputs (meshes,materials,wires) are empty
Hi Try the following code. The steel plates are only visible at the fine level. In order to get the plate brep you need to set the fine detail in revit view then execute the code.
import clr
clr.AddReference("RhinoCommon")
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
clr.AddReference("RhinoInside.Revit")
from Rhino.Geometry import *
from RhinoInside.Revit import Revit
from Autodesk.Revit import DB
from RhinoInside.Revit.Convert.Geometry import GeometryEncoder, GeometryDecoder
doc = Revit.ActiveDBDocument
# Execute: bool | Element: DB.Element | View: DB.View
if not Execute:
Result = None
else:
try:
opts = DB.Options()
opts.IncludeNonVisibleObjects = True
if View is not None:
opts.View = View
Result = []
for g in Element.get_Geometry(opts):
items = (
g.GetInstanceGeometry()
if isinstance(g, DB.GeometryInstance)
else [g]
)
for s in items:
if isinstance(s, DB.Solid) and s.Volume > 0:
Result.append(GeometryDecoder.ToBrep(s))
except Exception as e:
Result = str(e)
For anyone else also doing this - i highly recommend setting a 3D View just for the purpose of this script. Set the visibility and detail inside a template made for this script and never touch it lol (make sure your coworkers also don’t touch it)