Message 1 of 4
How to get LocationCurve for BuiltInCategory.OST_Roofs using c# .net
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi.
We have a Revit Addin under development that takes Revit components and converts them to SVG. We Get LocationCurve for walls, stairs, windows,and Rooms , Tessellate the curve and get Path for SVG from the Polylines of the tessellated curve. However for elements under BuiltInCategory.OST_Roofs, Locationcurve is returned as Null.
For other elements like wall if we take Element.Location as LocationCurve it works,
but for roofs same approach returns null.
FilteredElementCollector collector = new FilteredElementCollector(doc);
ElementCategoryFilter roofFilter = new ElementCategoryFilter(BuiltInCategory.OST_Roofs);
IList<Element> collection = collector.WherePasses(roofFilter).ToElements();
foreach(var elem in collection) {
//here variable locationcurve is returned null.
LocationCurve locationCurve = elem.Location as LocationCurve;
}