Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I'm trying to get the path of the conduit fitting by reading the center line geometry.
There is a way to do this in LookUp.
I followed the same logic:
foreach (FamilyInstance fitting in fittings)
{
GeometryElement geomElem = fitting.get_Geometry(options);
LocationPoint? lp = fitting.Location as LocationPoint;
IList<ElementId> centerlineIds = fitting.GetDependentElements(new ElementCategoryFilter(BuiltInCategory.OST_ConduitFittingCenterLine));
StringBuilder sb = new StringBuilder();
foreach (ElementId centerlineId in centerlineIds) {
sb.AppendLine(centerlineId.ToString());
Element? curve = doc.GetElement(centerlineId);
if (null != curve)
{
IEnumerable<GeometryObject> curves = curve.get_Geometry(new Options { IncludeNonVisibleObjects = true, ComputeReferences = true });
foreach (GeometryObject obj in curves)
{
TaskDialog.Show("Revit", "curve found");
}
}
}
}
First, I access all the instances of the Conduit Fittings in the model through element collector, then get their geometries. Using GetDependentElements I can reach the conduit fittings centerlines, which were supposed when I read their geometries (as done in LookUp) is to get the IEnumerable of the composing Arcs and Lines.
In line 20 of my code, I tried to cast to GeometryElement/GeometryObject/IEnumerable<GeometryObject> but they all return no objects.
Any ideas?
¯\_(ツ)_/¯
Let it work like a charm.
Mustafa Salaheldin

Digital Integration Manager, DuPod
Facebook | Twitter | LinkedIn
Solved! Go to Solution.