Part workPart = theSession.Parts.Work;
Part displayPart = theSession.Parts.Display;
// 获取所有实体对象
List<Body> bodies = new List<Body>();
Tag objTag = Tag.Null;
theUfSession.Obj.CycleObjsInPart(displayPart.Tag, UFConstants.UF_solid_type,ref objTag);
while (objTag != Tag.Null)
{
int type, subtype;
theUfSession.Obj.AskTypeAndSubtype(objTag, out type, out subtype);
if (type == 70 && subtype == 0)
{
Body b = (Body)NXOpen.Utilities.NXObjectManager.Get(objTag);
bodies.Add(b);
}
theUfSession.Obj.CycleObjsInPart(displayPart.Tag,UFConstants.UF_solid_type, ref objTag);
}
【NX二次开发】获取部件所有实体
于 2022-11-02 11:53:05 首次发布