zoukankan      html  css  js  c++  java
  • NX二次开发-创建直线UF_CURVE_create_line与NXOpen->CreateLine

     1     NX11+VS2013
     2     
     3     #include <uf.h>
     4     #include <uf_curve.h>
     5     #include <NXOpen/CurveCollection.hxx>
     6     #include <NXOpen/NXObject.hxx>
     7     #include <NXOpen/Part.hxx>
     8     #include <NXOpen/PartCollection.hxx>
     9     
    10     NXOpen::Session *theSession = NXOpen::Session::GetSession();
    11     NXOpen::Part *workPart(theSession->Parts()->Work());
    12     NXOpen::Part *displayPart(theSession->Parts()->Display());
    13     
    14     UF_initialize();
    15 
    16     //UFUN创建直线
    17     UF_CURVE_line_t Line_coords;
    18     Line_coords.start_point[0] = 0.0;
    19     Line_coords.start_point[1] = 0.0;
    20     Line_coords.start_point[2] = 0.0;
    21     Line_coords.end_point[0] = 100.0;
    22     Line_coords.end_point[1] = 100.0;
    23     Line_coords.end_point[2] = 100.0;
    24     tag_t Line = NULL_TAG;
    25     UF_CURVE_create_line(&Line_coords, &Line);
    26 
    27     //NXOpen C++创建直线
    28     NXOpen::Point3d StartPoint1(20.0, 80.0, 60.0);
    29     NXOpen::Point3d EndPoint1(200.0, 600.0, 700.0);
    30     NXOpen::Line *line1;
    31     line1 = workPart->Curves()->CreateLine(StartPoint1, EndPoint1);
    32 
    33     UF_terminate();

  • 相关阅读:
    洛谷P3157 [CQOI2011]动态逆序对
    CDQ分治
    快速数论变换(NTT)
    洛谷P3338 [ZJOI2014]力
    洛谷 P1919 A*B Problem升级版
    0-1分数规划
    洛谷P4593 [TJOI2018]教科书般的亵渎
    拉格朗日插值
    20180912-3 词频统计
    20190912-1 每周例行报告
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/10957289.html
Copyright © 2011-2022 走看看