在每个NX安装目录下都有案例,对应不同语言的源码,每个具体案例下会有一个说明文件,其中包含怎么运行和一些特殊说明,自己详细去看下。
如下是一个JAVA开发后工具应该放置的路径和设置的环境变量:
Files required
Any part file
ChangeFaceColor.java
ChangeFaceColor.dlx
The dlx file must be placed in one of the following locations:
From where NX session is launched
$UGII_USER_DIR/application
For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly recommended. This variable is set to a full directory path to a file containing a list of root directories for all custom applications. e.g., UGII_CUSTOM_DIRECTORY_FILE=\ugii\menus\custom_dirs.dat
以及如何运行这个工具的步骤:
Unless noted otherwise, the commands in these instructions must be run from an NX command prompt. See the general notes of the examples for instructions on how to start an NX command prompt.
Instructions for Windows: All commands are the same as in Unix except substitute "make" with "nmake -f Makefile_win".
Interactive mode
Compile the example with following command:
make
Start NX.
Open any part file with some faces that you can select to change the face color. You can also create a new part file and create some faces by inserting features that create solid geometry.
In NX, go to File - Execute - NX Open, select ChangeFaceColor.jar, and press Ok. The Change Face Color dialog will be displayed on the screen.
Select one or more faces in the Face Collector block. You can specify face selection intent rules from the Face Rule list on the NX Top Border Bar.
Select the new color for your selected faces using the Object Color Picker block.
Click OK or Apply to set the color of the selected faces to the new color.