NX二次开发-NXOPEN C#UF遍历函数theUfSession.Obj.CycleObjsInPart

NX9+VS2012

using
System; using NXOpen; using NXOpen.UF; using NXOpen.Utilities; //遍历当前显示部件所有实体 Tag PartTag = Tag.Null; theUfSession.Obj.CycleObjsInPart(theUfSession.Part.AskDisplayPart(), UFConstants.UF_solid_type, ref PartTag); while (PartTag != Tag.Null) { int type1; int subtype1; theUfSession.Obj.AskTypeAndSubtype(PartTag, out type1, out subtype1);//获得类型和子类型 if (type1 == UFConstants.UF_solid_type & subtype1 == UFConstants.UF_solid_body_subtype)//判断实体类型 { //设置颜色 theUfSession.Obj.SetColor(PartTag, 186); } theUfSession.Obj.CycleObjsInPart(theUfSession.Part.AskDisplayPart(), UFConstants.UF_solid_type, ref PartTag); } Caesar卢尚宇 2020年6月23日

猜你喜欢

转载自www.cnblogs.com/nxopen2018/p/13184730.html
今日推荐