# MotionSolve Environment Variables

MotionSolve uses environment variables to locate various files. When you invoke MotionSolve from MotionView, Altair Compute Console, or via the Run script, these environment variables are set automatically - you do not need to set them manually. However, if you launch one of the MotionSolve related executables (for example, mbd_d.exe, mspre.exe, msolve.exe, mpost.exe) at the command prompt, you need to first specify one or more of these environment variables.

Note: Quotes around the values of the variables should not be used in most cases.

## Required Environment Variables

Option Description
NUSOL_DLL_DIR Specifies the path of the MotionSolve binaries:

[install-path]\hwsolvers\motionsolve\bin\<platform>

PATH Specifies the location of liblmx-altair.dll required for licensing:

[install-path]\hwsolvers\common\bin\<platform>

RADFLEX_PATH Specifies the path of the MotionSolve licensing management executable:

[install-path]\hwsolvers\common\bin\<platform>

LD_LIBRARY_PATH ( Linux only) Specifies the path of any libraries that are loaded at runtime, for example, certain MotionSolve libraries:

[install-path]\hwsolvers\motionsolve\bin\linux64

Also, the MotionSolve licensing management executable:

[install-path]\hwsolvers\common\bin\linux64

ALTAIR_LICENSE_PATH Specifies a valid path for the Altair License File or a valid Altair License Server. This environment variable is not needed when running MotionSolve via the script motionsolve.bat
PYTHONHOME Specifies the location of the Python home directory in the MotionSolve installation, required when running simulations (or co-simulation with MotionSolve) for models that have Python user subroutines, for example:

[install-path]\common\python\python<version>\<platform>

DOS_DRIVE_$Assigns a Windows drive letter to Unix paths. You can then use a Windows-style path, starting with the drive letter, on Unix/Linux. MotionSolve, while parsing any path, replaces the drive letter and colon ($:) with the content of the respective environment variable. This facilitates using input files (XML, PY) with references to other files (for example, H3D) containing Windows drive letters in Unix.

Usage: DOS_DRIVE_$=path$ - Drive letter to be defined (case sensitive).

path - Unix path that you want to replace the drive letter with.

For example:

DOS_DRIVE_D = /home" changes "D:/users/mbs/workarea" to "/home/users/mbs/workarea".

## Optional Environment Variables

Option Description
MATLABROOT Sets the root directory for a MATLAB installation, which is required for batch co-simulation runs.
MS_CUSTOM_MAPPING_FILE Specifies the default custom mapping XML file.
MS_H3DFILE_DIR Enables you to set one or more paths to folders where MotionSolve will search for flexbodies if MotionSolve cannot find the flexbody file from the path located in the model file. Note that in the case where no path is specified in the model file, MotionSolve looks for the flexbody file in the directory where the solver input file resides.
MS_USERDLL_DIR Specifies the list of folders to be searched for the MotionSolve user-written subroutine DLLs/Python scripts. Separate folder names with a semi-colon (;).
MS_USERSUBDLL Specifies the filename for the MotionSolve user-written subroutine DLL file.
MS_USERMEX_DIR Specifies the location where the mapping files (*.m) reside when using MATLAB user subroutines in MotionSolve.

A set of mapping files is provided in the installation at: <altair_root>\hwsolvers\motionsolve\usersub\mex

MS_XSD_FILE Specifies the XML Schema Description file (XSD) path to be written to the MotionSolve XML file. The XSD file can be used by certain XML editors to validate the XML input file and check for syntax errors.
MS_XSL_FILE Specifies the XML Stylesheet Language file (XSL) path to be written to the MotionSolve XML file. The XSL file can be used by internet browsers and certain XML editors to render the XML input file into a tabular format specified in the XSL file.
MS_PLT_UNIQUE_TIME May be set to FIRST, LAST, or ALL to control which outputs are written to the .plt file when multiple outputs occur at the same time.
MS_AS_PORT Specifies an alternate port number for socket communication used in co-simulation between MotionSolve and AcuSolve. If not set, the default port number 94043 is used.
MSOLVE_PLT_EXTENSION Changes the extension of the PLT file. For example:

set MSOLVE_PLT_EXTENSION=req

PYTHONPATH Specifies the Python path to select a different version of Python for user subroutines.
PYTHONHOME Specifies the Python home directory to select a different version of Python for user subroutines.
COMPOSE_INSTALL_DIR Sets the root directory for a Compose installation to select a different version of Compose for user subroutines.