NX How to add OS environment variable to the load_options.def file to define Search Paths

2021-10-06T23:27:43Z
NX for Design

Summary


Details

Assembly Load Options are stored in a .def definition file, the local load_options.def file by default.
It might happen that the user wants to set a Search Path that is linked to an OS environment variable instead of setting manually (either in the Assembly Load Options UI or in the .def file).


The intent in this case is to get this set-up for current Assembly Load Options, but setting the Search Path to the environment within the .def file and not explicitly in the command UI (where you have to use explicit and existing paths).





Solution


In the Assembly Load Options .def file (the ootb default is the load_options.def file found within %UGII_BASE_DIR%\UGII folder) the very first line is used to define Search Paths.



In order to enter there an OS enviroment variable so it will eventually turn to the explicit path/folder please use this syntax in your assembly load options definition file:


                              ${MY_VAR}



Once saved the .def file if you execute NX and switch to the From Search Paths load option in the Assembly Load Option UI you will find out it works as expected.


However be aware that if you make any modification in the UI and save there the .def file then the env. variable in the .def file will be overwritten and replaced by the full explicit path.

KB Article ID# PL8511009

Contents

SummaryDetails

Associated Components

Assemblies