Build a NX Open .NET application

本文介绍如何使用Visual Studio IDE创建并发布NXOpen.NET应用程序。包括设置项目、添加引用、编写Main()函数、编译测试及签名流程。确保最终用户无需.NET授权许可即可使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

A basic setup to build a NX Open .NET application using Visual Studio (IDE)

Interactive Application: .NET authoring license is required

Start Visual Studio 2003 (7.1)

Create class library project

  • File -> New -> Project -> Visual C# Projects (project types) -> Class Library

Add references

  • Project -> Add Reference…

Browse to UGII_BASE_DIR\UGII\managed\ Add the following files

  • NXOpen.dll
  • NXOpen.Utilities.dll
  • NXOpen.UF.dll
  • NXOpenUI.dll (only needed if you build an user interface for your application)

Add Main() function to the class

            public static void Main()       

           {

           }

Compile and build the application

Test Appilcation:

Launch NX

Run your sample application

  • File -> Execute -> NX/Open… (browse to your sample application \bin\Debug\ location, select your application.dll)

Sign Application:

In order to release an application and have non programers use this (someone without a .NET authoring license) you need to sign your application.

Add resource file NXSigningResource.res to your Visual Studio project

  • File -> Add Existing Item -> browse to UGII_BASE_DIR\UGOPEN\NXSigningResource.res

Set the NXSigningResource.res file Build Action to Embedded Resource

  • Properties on the NXSigningResource.res file that’s attached to your Visual Studio project

Sign the application, at a command prompt:

  • UGII_BASE_DIR\UGII\SignLibrary.exe yourSampleApplicationLocation\sampleApplication.dll

If you don’t sign your application when you release it to your end users, they will be required to have a “.NET authoring license”. This is very costly and unnecesary.

Set your Project Configuration Build to Release This will change the build arguments and remove the unnecessary debug statements for the released application

  • Build -> Configuration Manager
  • Set “Active Solution Configuration” to Release

Compile, Build, and test

Summary

This application does not do anything but it does set up the foundation needed to get an application built using the Visual Studio IDE and have it signed for release.

reference:

http://plmexchange.net/build-a-nx-open-net-application/#comment-713

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值