zoukankan      html  css  js  c++  java
  • NX二次开发-使用NXOPEN C#手工搭建开发环境配置

    新建类库

    进来后编译代码,成功

     添加NXOPEN的库到项目中

     

     

     不同NX版本,可能dll所在位置不一样,NX11以上版本在NXBIN这里,NX11以下版本大概在UGII。

     添加头文件

    using NXOpen;
    using NXOpen.Utilities;
    using NXOpen.UF;

    添加源代码

     1 public static Session theSession;
     2 public static UFSession theUfSession;
     3 public static UFUi theUFUi;
     4 
     5 public static int Main()
     6 {
     7     theSession = Session.GetSession();
     8     theUfSession = UFSession.GetUFSession();
     9     theUFUi = theUfSession.Ui;
    10 
    11     theUFUi.DisplayMessage("Hello,world!", 1);
    12 
    13     FeatureSigns sign = FeatureSigns.Nullsign;//定义布尔
    14     double[] cornet_pt = { 100.0, 0.0, 0.0 };//定义原点
    15     string[] edge_len = { "100.0", "100.0", "100.0" };//定义长宽高
    16     Tag blk_obj_id = Tag.Null;
    17     theUfSession.Modl.CreateBlock1(sign, cornet_pt, edge_len, out blk_obj_id);
    18 
    19     return (0);
    20 }
    21 
    22 public static int GetUnloadOption(string dummy)
    23 {
    24     return UFConstants.UF_UNLOAD_IMMEDIATELY;
    25 }
    26 
    27 Caesar卢尚宇
    28 2020年2月24日

     

  • 相关阅读:
    静态方法中访问类的实例成员
    静态初始化块
    Java字段初始化的规律
    java中函数重载
    哈姆雷特观后感 一把辛酸泪
    枚举
    验证码
    四则运算
    JAVA输出中+号的作用以及如何使用
    dev控件ASPxComboBox设置ReadOnly="true"后
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/12358851.html
Copyright © 2011-2022 走看看