The Sandbox: Creating a NX CAM Development Environment
The Sandbox: Creating a NX CAM Development Environment
As manufacturing technology advances, the demand for advanced tool paths and machine simulations has also increased. OOTB (out of the box) NX CAM provides a full suite of operations that are more than capable of producing advanced tool paths. With this increase in demand, companies are striving for a faster, more efficient process for programming parts.
Developing these processes often require changes to be made to the OOTB installation. However, we do not want to disrupt the workflow of colleagues who also utilize the software. Creating a development environment for our NX installation will allow new features to be developed and tested without jeopardizing the functionality of the production environment, allowing our colleagues to continue working uninterrupted.
We will begin with an outline of the steps required to create our custom NX CAM development (dev) environment:
- Create a folder for the dev environment.
- Copy the “resource” folder from the NX installation “MACH” folder and paste it into the newly created dev environment folder.
- Copy the “ugii_env.dat” file from the NX installation “UGII” folder and paste it into the same directory as the “resource”
- Add the UGII_CAM_RESOURCE_DIR environment variable to the “ugii_env.dat”
- Create a shortcut to the “ugraf.exe”
- Change the “Start in” path of the shortcut to the directory where the “resource” folder resides.
- Open NX with the newly created shortcut and verify that the development environment is implemented correctly by examining the system log file.
STEP 1 – Create a folder for the development environment
Place the folder anywhere outside of the production installation of NX. In this example, I have created a folder named “sandbox” in the Documents directory on my local drive. You can call your folder whatever you like (workspace, dev_env, playground, etc.).
STEP 2 – Copy the “resource” folder from the NX installation “MACH” folder and paste it into the newly created development environment folder
Navigate to YOUR_NX_INSTALL_LOCATION > NXversion > MACH and COPY the “resource” folder.
Next, navigate to the new dev environment directory and PASTE the “resource” folder. In my case, I have dev environments created for each installation of NX. I keep them separate by creating an additional folder for each install called “dev_2206” or “dev_1980”, depending on the target installation. Feel free to skip this step if you only have a single version of NX installed. You will also notice an additional “nx” folder in the path name. This folder is unnecessary but will help keep things organized as we add more folders and files.
STEP 3 – Copy the “ugii_env.dat” file from the NX installation “UGII” folder and paste it into the same directory as the “resource” folder
COPY the “ugii_env.dat” file from YOUR_NX_INSTALL_LOCATION > NXversion > UGII directory.
PASTE the “ugii_env.dat” file into the same directory as the “resource” folder.
STEP 4 – Add the UGII_CAM_RESOURCE_DIR environment variable to the “ugii_env.dat” file
Open the “ugii_env.dat” file in any text editor (Notepad++, VSCode).
Navigate to the “resource” folder and copy the path name.
In the “ugii_env.dat” open in your text editor, add the UGII_CAM_RESOURCE_DIR variable and set it to the copied path name of the “resource” folder. Be sure to add a backslash “\” to the end of the path name.
By adding the above variable to the “ugii_env.dat” file, NX will override the default “resource” directory with the dev environment “resource” directory.
STEP 5 – Create a shortcut to “ugraf.exe” (NX executable)
Locate the NX shortcut from the Windows Start Menu and open the file location: Siemens NX > NXversion, right-click on the shortcut > More > Open file location.
Right-click the shortcut and Open file location.
The “ugraf.exe” is in YOUR_NX_INSTALLATION > NXversion > NXBIN. Create a shortcut to this file on your desktop.
Rename the shortcut to differentiate between the production environment and the development environment. I have renamed mine to “dev_2206”. I have also moved the shortcut into the dev environment folder to stay organized. Doing this is not required.
STEP 6 - Change the “Start in” path of the shortcut to the directory where the “resource” folder resides
Open the Properties dialog of the shortcut.
Copy the path name where the “resource” folder resides and paste into the “Start in” textbox of the Properties dialog:
STEP 7 – Open the NX CAM development environment and verify that the UGII_CAM_RESOURCE_DIR is overriding the production environment
At this point, we have a fully functioning development environment and are ready to start “playing in our sandbox.” Open NX from the shortcut we just created.
We need to open the log file to examine all the libraries NX is loading.
Menu > Help > Log File
In the log file, perform a search for “UGII_CAM_RESOURCE_DIR” variable and examine the path name being sourced:
Take note of the variables above and below the UGII_CAM_RESOURCE_DIR variable. The default libraries from the production environment continue to be loaded. However, any CAM templates, post-processors, machines, materials, tooling, feeds and speeds, etc., will be sourced from our development environment.
In this tutorial, we’ve created an NX CAM development environment that allows us to create and test new features and workflows without disrupting the production process of our colleagues.
My name is Aaron Jackson, I’m a NX CAM Application Engineer and Technical Support Lead at Swoosh Technologies and Solutions. With nearly 20 years of experience in manufacturing, as both a CNC programmer and a CNC Machine Tool Applications Engineer, I bring a wealth of knowledge and experience from various manufacturing sectors, including the medical, defense, communications, and automotive industries.