NX9+VS2012 using System; using NXOpen; using NXOpen.UF; using NXOpenUI; using NXOpen.Utilities; //获取WCS Tag WcsId = Tag.Null; theUfSession.Csys.AskWcs(out WcsId); //获取WCS的矩阵和原点 Tag MatrixId = Tag.Null; double[] CsysOrigin = new Double[3]; theUfSession.Csys.AskCsysInfo(WcsId, out MatrixId, CsysOrigin); //画两个整圆 UFCurve.Arc HoleArcCoords1 = new UFCurve.Arc(); HoleArcCoords1.matrix_tag = MatrixId; HoleArcCoords1.start_angle = 0 * UFConstants.DEGRA; HoleArcCoords1.end_angle = 360 * UFConstants.DEGRA; HoleArcCoords1.arc_center = new Double[3]; HoleArcCoords1.arc_center[0] = 0.0; HoleArcCoords1.arc_center[1] = 0.0; HoleArcCoords1.arc_center[2] = 0.0; HoleArcCoords1.radius = 100; Tag HoleArcTag1 = Tag.Null; theUfSession.Curve.CreateArc(ref HoleArcCoords1, out HoleArcTag1); UFCurve.Arc HoleArcCoords2 = new UFCurve.Arc(); HoleArcCoords2.matrix_tag = MatrixId; HoleArcCoords2.start_angle = 0 * UFConstants.DEGRA; HoleArcCoords2.end_angle = 360 * UFConstants.DEGRA; HoleArcCoords2.arc_center = new Double[3]; HoleArcCoords2.arc_center[0] = 0.0; HoleArcCoords2.arc_center[1] = 0.0; HoleArcCoords2.arc_center[2] = 0.0; HoleArcCoords2.radius = 120; Tag HoleArcTag2 = Tag.Null; theUfSession.Curve.CreateArc(ref HoleArcCoords2, out HoleArcTag2); //创建链表 Tag[] ArcList = new Tag[2]; theUfSession.Modl.CreateList(out ArcList); //插入对象到链表 theUfSession.Modl.PutListItem(ref ArcList, HoleArcTag1); theUfSession.Modl.PutListItem(ref ArcList, HoleArcTag2); //创建拉伸 string[] HoleLimit = { "0.0", "50.0" }; double[] HolePoint = { 0.0, 0.0, 0.0 }; double[] HoleDirection = { 0.0, 0.0, 1.0 }; Tag[] HoleExtrudedTag = new Tag[1]; theUfSession.Modl.CreateExtruded(ArcList, "0", HoleLimit, HolePoint, HoleDirection, FeatureSigns.Nullsign, out HoleExtrudedTag); //特征找体 Tag HoleBodyTag = Tag.Null; theUfSession.Modl.AskFeatBody(HoleExtrudedTag[0], out HoleBodyTag); //创建颜色 theUfSession.Obj.SetColor(HoleBodyTag, 186); //设置透明度 theUfSession.Obj.SetTranslucency(HoleBodyTag, 60); Caesar卢尚宇 2020年6月27日
NX二次开发-NXOPEN C#UF获取WCS theUfSession.Csys.AskCsysInfo
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
获取IP地址
端点(API接口)访问获取IP地址!
IP Java SpringBoot\ -
python 获取句柄标题 python获取窗口句柄
Python获取窗口句柄,下载win32gui模块方法
python win32gui 句柄