首页 > 代码库 > NX7.5 使用UF_MODL_create_proj_curves创建投影曲线
NX7.5 使用UF_MODL_create_proj_curves创建投影曲线
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创建投影曲线
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。