Message 1 of 12
Not applicable
12-23-2019
06:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I want to define the top surface plane of a structural beam.
So I need to retrieve at least 3 points from the top face of a structural beam. However, with the following code, I am stuck.
FilteredElementCollector collector = new FilteredElementCollector(Global.doc()).WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_StructuralFraming); // select all structural framing(beams)
List<Element> beamList = collector.ToList(); // select all structural beams as a List
for (int i = 0; i < allBeamList.Count; i++)
{
beamGeo = beamList[i].get_Geometry(geomOptions);
foreach (GeometryObject geomObj in beamGeo)
{
geomSolid = geomObj as Solid;
try
{
foreach (Face geomFace in geomSolid.Faces)
{
face = geomFace;
edges = face.GetEdgesAsCurveLoops();
break;
}
}
catch{}
}
}From the edges following info is got but I couldn't make sense of any of them. Any help is much appreciated!
- [Autodesk.Revit.DB.Line] {Autodesk.Revit.DB.Line} Autodesk.Revit.DB.Line
+ Direction {(0.883461516, -0.468503734, 0.000000000)} Autodesk.Revit.DB.XYZ
+ Origin {(41.600096955, 43.315422219, 0.984251969)} Autodesk.Revit.DB.XYZ
Solved! Go to Solution.

Developer Advocacy and Support +