Extracting sweep from mass
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I'd like to be able to extract the sweep path of the mass (to detect the interpolated points on the spline) in the this revit project. I can't find many details on how to do this, I was starting with the code below.
Any assistance greatly appreciated, happy to clarify as needed.
Jon
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
Document doc = commandData.Application.ActiveUIDocument.Document;
Application app = commandData.Application.Application;
ElementSet selection = commandData.Application.ActiveUIDocument.Selection.Elements;
if (selection.Size <= 0)
{
message = "Must have Mass preselected!";
return Result.Failed;
}
Transaction trans = new Transaction(doc, "ExtractGeometry");
FailureHandlingOptions fho = trans.GetFailureHandlingOptions();
fho.SetFailuresPreprocessor(new WarningSwallower());
trans.SetFailureHandlingOptions(fho);
trans.Start();
foreach (Element e in selection)
{
FamilyInstance familyComponent = e as FamilyInstance;
if (familyComponent != null)
{
Options o = new Options();
GeometryElement ge = familyComponent.get_Geometry(o);
foreach (GeometryObject geomObj in ge)
{
GeometryInstance gi = geomObj as GeometryInstance;
if (gi != null)
{
string s = geomObj.GetType().ToString();