【发布时间】:2017-07-25 16:01:46
【问题描述】:
我正在尝试查找扫掠折线的顶点。 所以我有一个实体,它是通过沿着 3D 折线扫过一个圆来创建的。 看起来是这样的:image of sweeped solid
上周整个星期五都在谷歌上搜索,我想我必须玩弄子实体部分。例如,我发现了如何更改子实体边缘的颜色,但看在上帝的份上,我找不到如何访问几何
这是我迄今为止尝试过的,但正如我在底部所指出的那样,我有点迷路了:
[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();
}
}
【问题讨论】:
-
如何将实体导出到 DXF 并查看文本文件中数据的构成?它可能会向您解释子实体的机制。我对手头的案例没有具体的了解,但是,如果它们是“id”,那么接下来你会“打开”那些 id 的什么?这些将返回提供坐标数据的合适对象。但这是一个猜测。查看 DXF 可能会显示更多信息。也许您可以将其添加到您的问题中。