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日
