1 NX11+VS2013
2
3 using System;
4 using NXOpen;
5 using NXOpen.UF;
6
7
8 //创建圆柱
9 FeatureSigns sign = FeatureSigns.Nullsign;//定义布尔
10 double[] origin = { 100.0, 0.0, 0.0 };//定义原点
11 string height = "100";//定义高
12 string diam = "50";//定义直径
13 double[] direction = { 0.0, 0.0, 1.0 };//定义向量
14 Tag cyl_obj_id = Tag.Null;
15 theUfSession.Modl.CreateCyl1(sign, origin, height, diam, direction, out cyl_obj_id);
16
17 //特征找体
18 Tag body_obj_id = Tag.Null;
19 theUfSession.Modl.AskFeatBody(cyl_obj_id, out body_obj_id);
20
21 //设置颜色
22 theUfSession.Obj.SetColor(body_obj_id, 186);
23
24 Caesar卢尚宇
25 2020年2月15日
NX二次开发-NXOPEN C#UF特征找体theUfSession.Modl.AskFeatBody