hm_ce_getvalidabsolutepath

Returns a valid absolute path from a relative path.

Syntax

hm_ce_getvalidabsolutepath relative_path

Type

HyperMesh Tcl Query

Description

Returns a valid absolute path from a relative path. Returns an empty string if the relative path could not be converted into a valid absolute path.

Inputs

relative_path
The relative path of the file/folder. Supported relative path tags:
[ALTAIR_HOME] – Current installation base directory.
[CURRENTWORKINGDIR] – Current working directory.
[EXECUTABLEDIR] – Full directory path of the application’s executable.
[hm_scripts_dir] – HM scripts directory.
[HW_CONFIG_PATH] – Paths in HW_CONFIG_PATH environment variable.
[USER_HOME] – User home directory.

Example

To get the absolute path for the user home relative path:

hm_ce_getvalidabsolutepath {[USER_HOME]/Some_Folder/Some_File.txt}
Returns: {C:/Users/username/Some_Folder/Some_File.txt}

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

14.0.110