I am trying to find the vertex points of a swept polyline. So i have a solid that was created by sweeping a circle along a 3D polyline. It looks like that:
Googeling the whole of friday last week i think i have to play around with the subentity part. I found out how to change the color of the subentity edges for instance, but couldnt for christs sake not find out how to access the geometric
This is what i tried out so far, but as i noted right at the bottom i am kinda lost there. (or am i completly on the wrong path with subentity)
(long story short, I want to get the coordinates of the vertices of the 3D solid that was swept from a 3dpolyline by using a circle)
[CommandMethod("SubEntExample")]
public void SubEntExample()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
PromptEntityOptions peo = new PromptEntityOptions("\nSelect a 3D solid: ");
peo.SetRejectMessage("\nInvalid selection...");
peo.AddAllowedClass(typeof(Solid3d), true);
PromptEntityResult per = ed.GetEntity(peo);
if (per.Status != PromptStatus.OK)
return;
using (Transaction Tx = db.TransactionManager.StartTransaction())
{
Solid3d solid = Tx.GetObject(per.ObjectId, OpenMode.ForWrite) as Solid3d;
ObjectId[] ids = new ObjectId[] { per.ObjectId };
FullSubentityPath path = new FullSubentityPath(ids, new SubentityId(SubentityType.Null, IntPtr.Zero));
List<SubentityId> subEntIds = new List<SubentityId>();
using (Autodesk.AutoCAD.BoundaryRepresentation.Brep brep =
new Autodesk.AutoCAD.BoundaryRepresentation.Brep(path))
{
foreach (Autodesk.AutoCAD.BoundaryRepresentation.Edge edge in brep.Edges)
{
subEntIds.Add(edge.SubentityPath.SubentId);
}
}
foreach (SubentityId subentId in subEntIds)
{
*** here i am lost ***
}
Tx.Commit();
}
}