如题
如果是通过CE上边新的构造参数化实体的工具够造出来的参数化实体的话可以通过下面的代码获取到:
ElementAgenda selectset; SelectionSetManager::GetManager().BuildAgenda(selectset); if (!selectset.GetCount()) { return; } ElementHandle& eh = selectset[0]; if (SmartFeatureElement::IsSmartFeature(eh)) { mdlDialog_dmsgsPrintA("The identified element is a SmartFeatureElement"); SmartFeatureNodePtr pFeatureNode; StatusInt status = SmartFeatureElement::ExtractTree(pFeatureNode, eh); status = SUCCESS; T_SmartFeatureVector allChildren; pFeatureNode->GetAllChildrenRecursively(allChildren); for (SmartFeatureNodePtr pNode : allChildren) { ElementHandle curEh; if (SUCCESS == pNode->GetLeaf(curEh)) { printf("ID=%d\n", curEh.GetElementId()); } } }
如果是通过老的v8i工具构造出来的智能实体的话,就不太好获取了,只能是将智能实体打散,然后根据打散后获取到的曲线的几何位置关系去判断哪个是面,哪个是路径。
多谢郭老师!