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();
Dear Jon,
Thank you for your query.
I looked at your sample model and see the mass element.
You can explore it and its geometry using RevitLookup.
I do not see any possibility to access the underlying sweep path at all.
All you have access to is the solid, its faces and edges.
Since in this case the solid is a long, thin extrusion, it would be possible to analyse it and deduce the sweep line, more or less, but that is a non-trivial task, I would assume, and I do not see any support for such an undertaking in the Revit API.
How was this shape generated?
Could you access the sweep line earlier on in the process?
I hope this helps.
Best regards,
Jeremy
Can't find what you're looking for? Ask the community or share your knowledge.