山西省大同市网站建设公司,个人简历免费模板,电话销售做网站认证,龙岩网站建设找哪家大家好#xff0c;今天继续讲解我们的通用方法系列。
下面是今天要介绍的通用方法#xff1a;
#xff08;1#xff09;这个通用方法为ug获取选择圆边的圆心
/// summary /// ug获取选择圆边的圆心 /// /summary /// param namea今天继续讲解我们的通用方法系列。
下面是今天要介绍的通用方法
1这个通用方法为ug获取选择圆边的圆心
/// summary /// ug获取选择圆边的圆心 /// /summary /// param namea/param /// returns/returns public static double[] Getyuanxin(Tag a)//获取选择圆边的圆心 { int type; theUFSession.Modl.AskEdgeType(a, out type); double[] p new double[3]; if (type 3002) { IntPtr uFEval; theUFSession.Eval.Initialize(a, out uFEval); UFEval.Arc arc_coords; theUFSession.Eval.AskArc(uFEval, out arc_coords); p[0] arc_coords.center[0]; p[1] arc_coords.center[1]; p[2] arc_coords.center[2]; } return p;
}
2这个通用方法为ug获取tag
/// summary /// ug获取tag /// /summary /// param nameb/param /// returns/returns public static Tag Getplan(Tag b) { Tag aTag.Null; Tag[] facelist null; theUFSession.Modl.AskEdgeFaces(b, out facelist); for (int i 0; i facelist.Length; i) { int type1; theUFSession.Modl.AskFaceType(facelist[i], out type1); if (type1 22) { a facelist[i]; } } return a; }
3这个通用方法为ug删除孔 /// summary /// ug删除孔 /// /summary /// param nameb/param public static void Deletekong(Tag b)//删除孔 { NXOpen.Part workPart theSession.Parts.Work; Tag[] facelist null; theUFSession.Modl.AskEdgeFaces(b, out facelist); for (int i 0; i facelist.Length; i) { int type1; theUFSession.Modl.AskFaceType(facelist[i], out type1); if (type1 17 || type1 16) { NXOpen.Face face1 (NXOpen.Face)NXObjectManager.Get(facelist[i]); NXOpen.FaceBossPocketFacesRule faceBossPocketFacesRule1; faceBossPocketFacesRule1 workPart.ScRuleFactory.CreateRuleFaceBossPocket(face1); NXOpen.SelectionIntentRule[] rules1 new SelectionIntentRule[1]; rules1[0] faceBossPocketFacesRule1; NXOpen.ScCollector scCollector1 workPart.ScCollectors.CreateCollector(); scCollector1.ReplaceRules(rules1, false); TaggedObject[] BB new TaggedObject[scCollector1.GetObjects().Length]; BB scCollector1.GetObjects(); Face[] faces new Face[0]; foreach (var to in BB) { Array.Resize(ref faces, faces.Length 1); faces[faces.Length - 1] (Face)to; } DeleteFace(faces); } } }
今天要介绍的通用方法就这些我们下篇文章再见。