ObjectArx子实体自定义高亮面

// 选择立方体
ads_name ename = { 0 };
ads_point selPnt = { 0 };
acedEntSel(_T("请选择立方体"), ename, selPnt);
AcDbObjectId oid = AcDbObjectId::kNull;
acdbGetObjectId(oid, ename);

AcDbEntity* pEnt = NULL;
acdbOpenObject(pEnt, oid, AcDb::kForRead);

// 高亮显示立方体的6个面
for (int i = 0; i < 6; ++i)
{
    AcDbFullSubentPath subPath;
    subPath.objectIds().removeAll();
    subPath.subentId() = AcDbSubentId(AcDb::kFaceSubentType, i);
    pEnt->highlight(subPath);
}

pEnt->close();

  子实体的类型:

AcDb::kNullSubentType
AcDb::kFaceSubentType
AcDb::kEdgeSubentType
AcDb::kVertexSubentType
posted @ 2024-08-14 14:27  unicornsir  阅读(17)  评论(0编辑  收藏  举报