码迷,mamicode.com
首页 > 其他好文 > 详细

NX7.5 使用UF_MODL_create_proj_curves创建投影曲线

时间:2017-04-07 13:19:16      阅读:488      评论:0      收藏:0      [点我收藏+]

标签:创建   cer   error   point   rtu   cto   return   需要   投影   

 1  [DllImport("libufun.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, EntryPoint = "UF_MODL_create_proj_curves")]
 2     internal static extern int _CreateProjCurves(System.IntPtr curveRefs, System.IntPtr faceRefs, int alongFaceNormal, double[] projVector, out NXOpen.Tag projCurveFeature);
 3 
 4     [DllImport("libufun.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, EntryPoint = "UF_MODL_create_list")]
 5     internal static extern int CreateList(out System.IntPtr list);
 6     [DllImport("libufun.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, EntryPoint = "UF_MODL_put_list_item")]
 7     internal static extern int PutListItem(System.IntPtr list, NXOpen.Tag objId);
 8 
 9     internal static System.IntPtr ListFromArray(NXOpen.Tag[] array)
10     {
11         System.IntPtr intPtr;
12         CreateList(out intPtr);
13         for (int i = 0; i < array.Length; i++)
14         {
15             PutListItem(intPtr, array[i]);
16         }
17         return intPtr;
18     }
19 
20    /// <summary>
21    /// 创建投影特征
22    /// </summary>
23    /// <param name="curveRefs">需要投影的曲线</param>
24    /// <param name="faceRefs">投影面</param>
25    /// <param name="alongFaceNormal">是否使用面的法向</param>
26    /// <param name="projVector">指定矢量</param>
27    /// <param name="projCurveFeature">投影的特征</param>
28     public void CreateProjCurves(NXOpen.Tag[] curveRefs, NXOpen.Tag[] faceRefs, int alongFaceNormal, double[] projVector, out NXOpen.Tag projCurveFeature)
29     {
30         System.IntPtr curveRefs2 = ListFromArray(curveRefs);
31         System.IntPtr faceRefs2 = ListFromArray(faceRefs);
32         NXOpen.Utilities.JAM.StartUFCall();
33         int error = _CreateProjCurves(curveRefs2, faceRefs2, alongFaceNormal, projVector, out projCurveFeature);
34         NXOpen.Utilities.JAM.EndUFCall();
35         if (error != 0)
36         {
37             throw NXOpen.NXException.Create(error);
38         }
39     }

 

NX7.5 使用UF_MODL_create_proj_curves创建投影曲线

标签:创建   cer   error   point   rtu   cto   return   需要   投影   

原文地址:http://www.cnblogs.com/bizca/p/6677682.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!