Skip to content

Commit

Permalink
Update FaceIntersectCommand.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Jun 26, 2024
1 parent 405e3ce commit 9159aa7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Test/FaceIntersectCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme
{
Trace.WriteLine(xyz.ToString());
}
// create direct shape
using Autodesk.Revit.DB.Transaction trans = new Transaction(doc, "Create Direct Shape");
trans.Start();
DirectShape ds = DirectShape.CreateElement(doc, new ElementId(BuiltInCategory.OST_GenericModel));
ds.ApplicationId = "ApplicationId";
ds.ApplicationDataId = "ApplicationDataId";
var curveloop = new CurveLoop();
for (int i = 0; i < intersection.Count; i++)
{
curveloop.Append(Line.CreateBound(intersection[i], intersection[(i + 1) % intersection.Count]));
}
Solid solid = GeometryCreationUtilities.CreateExtrusionGeometry(new List<CurveLoop> { curveloop }, XYZ.BasisZ, 1);
ds.SetShape(new GeometryObject[] { solid });
trans.Commit();
return Result.Succeeded;
}
public PlanarFace? GetTopFace(Extrusion? extrusion)
Expand Down

0 comments on commit 9159aa7

Please sign in to comment.