zoukankan      html  css  js  c++  java
  • 外部开发:部件属性 外部exe启动UG NX

    NX支持外部读取修改部件属性,修改后注意需要保存,UF_PART_save();

    外部exe启动UG NX            

                    1 用.net2003建立一个控制台应用程序   2 将目录ugiimanaged下除ManagedLoader.dll外的dll文件加入到你的工程里面的References   3 将下面的代码复制到你的Main函数里面                theSession = Session.GetSession();                                theSession.Parts.NewDisplay("d:\1.prt",NXOpen.Part.Units.Millimeters);                NXOpen.Features.Feature nullFeatures_Feature = null;                NXOpen.Part pp=theSession.Parts.Work;                myblock = pp.Features.CreateBlockFeatureBuilder(nullFeatures_Feature) ;                Point3d ps = new Point3d(0.0, 0.0, 0.0);                myblock.SetOriginAndLengths(ps, "100", "100", "100");                myblock.CommitFeature();                NXOpen.PartSaveStatus status;                theSession.Parts.Work.Save(NXOpen.Part.SaveComponents.True,NXOpen.Part.CloseAfterSave.False, out status);       4 修改项目的属性,将输出文件定位到ugii目录   5 编译直接运行生成的exe文件(不需要启动UG)   6 在d:下会生成文件1.prt    using System;   using NXOpen;   using NXOpen.UF;       namespace drawBlock   {      class Class1      {        public static Session theSession;        public static UFSession theUFSession;            static void Main(string[] args)        {          theSession = Session.GetSession();           theUFSession = UFSession.GetUFSession();           theSession.Parts.NewDisplay("d:\1.prt",NXOpen.Part.Units.Millimeters);               NXOpen.Features.Feature nullFeatures_Feature = null;           NXOpen.Part pp=theSession.Parts.Work;               NXOpen.Features.BlockFeatureBuilder myblock=pp.Features.CreateBlockFeatureBuilder(nullFeatures_Feature) ;          Point3d ps = new Point3d(0.0, 0.0, 0.0);           myblock.SetOriginAndLengths(ps, "100", "100", "100");           myblock.CommitFeature();           NXOpen.PartSaveStatus status;           theSession.Parts.Work.Save(NXOpen.Part.SaveComponents.True,NXOpen.Part.CloseAfterSave.False, out status);        }      }   }
     
     
     

    set UGII_BASE_DIR="D:SiemensNX80" set UGII_LANG=simpl_chinese set UGII_ROOT_DIR="D:SiemensNX80UGII"

    D: cd "D:SiemensNX80UGII"

    set USER_STARTUP=C:TWBKFapplicationYQ_PrintPDF_Auto.dll start "UG80" "D:SiemensNX80UGIIugraf.exe"

    echo on rem pause exit

  • 相关阅读:
    在pytorch中使用可视化工具visdom
    3"GAN-GAN实战:GD的实现
    31:GAN-js散度的缺陷以及解决办法:WGAN的提出
    31:GAN-DCGAN(deconvolution GAN逆卷积操作)以及JS散度的缺陷
    31:GAN-纳什均衡
    31:GAN-GAN原理
    30:无监督学习-自编码网络的变种
    30:无监督学习-自编码(Auto-Encoder简称AE)原理
    如何打印网络的参数量
    29:迁移学习(当数据集比较小时,可以使用迁移学习达到一个更好的效果)
  • 原文地址:https://www.cnblogs.com/whiteIcrow/p/3857809.html
Copyright © 2011-2022 走看看