getenv

(getenv [var_name] [ini_section] [ini_file])

The getenv function retrieves a string value assigned to a list containing the environment variables as found in the [CAD Path] section of an INI file. For example:

Arguments

var_name specifies the identifier (profile name) of the variable to be retrieved.

ini_section specifies the identifier (name) of a section of the specified INI file.

ini_file specifies the complete name of the INI file (including drive and path).

Return Value

The function returns a string containing the environment setting if it succeeds. It returns nil if it fails. If the getenv function is utilized without arguments, it returns a dotted pair list containing the settings of the system paths and system files as defined in the application INI file.

Keyword Description
"CADSYS" System directory (where the executables and DLL files are located).
"CADCFG" Path to the configuration directory
"CADDEV" Directory for device driver interface files (currently only tablet driver interface DLL; normally the same as the kernel directory - see "CADSYS")
"CADSUP" Path for menu files (.mnu, .mnp, .mnt). Application search path (one or more directory paths separated by a semicolon)
"CADTMP" Directory for temporary user-specific files (Undo-List files and Display-List files)
"CADHLP" Help file name
"CADDWG" Default directory for drawings
"CADCMD" System directory (containing the command DLL's; normally the same as "CADSYS")
"CADDLG" Path for dialog box files (.dlg files)
"CADKEY" KEY filename

Examples

: (getenv)

(("CADSYS" . "D:\\Program Files (x86)\\corporation_name\\application_name\\BIN") ("CADCFG" . "C:\\Users\\user_name\\AppData\\Roaming\\application_name\\version_spec") ("CADFONT" . "C:\\Program Files (x86)\\corporation_name\\application_name\\Fonts;C:\\Users\\prasuhn\\AppData\\Roaming\\application_name\\version_spec\\Fonts") ("CADMNU" . "C:\\Users\\user_name\\AppData\\Roaming\\application_name\\version_spec\\UI\\english") ("CADSUP" . "C:\\Users\\user_name\\AppData\\Roaming\\application_name\\version_spec\\Support;C:\\Program Files (x86)\\corporation_name\\application_name\\Default Files\\Support") ("CADTMP" . "C:\\DOCUME~1\\user_name\\LOCALS~1\\TEMP\\application_name_TEMP \\") ("CADHLP" . "D:\\Program Files (x86)\\corporation_name\\application_name\\Help\\applica tion_name.chm") ("CADDWG" . "C:\\Users\\user_name\\Documents\\My Drawings") ("CADCMD" . "D:\\Program Files (x86)\\corporation_name\\application_name\\BIN") ("CADDLG" . "C:\\Users\\user_name\\AppData\\Roaming\\application_name\\version_spec\\Support;C:\\Program Files (x86)\\corporation_name\\application_name\\Default Files\\Support") ("CADKEY" . "C:\\Users\\user_name\\AppData\\Roaming\\application_name\\version_spec\\Alias\\alias.xml"))

: (getenv "CADSYS")

"C:\\Program Files (x86)\\corporation_name\\application_name\\BIN"

: (getenv "PATH")

"C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\system32\\WBEM;C:\\Program Files\\corp oration_name\\application_name\\BIN\\"

: (getenv "OS")

"Windows_NT"

: (getenv "TEMP")

"C:\\Users\\user_name\\AppData\\Local\\Temp"

: (getenv "WINDIR")

"C:\\Windows"

: (getenv "timer" "drivers" "system.ini")

"timer.drv"

Related Functions

getcfg, setcfg