CurrentModelFolder

(Redirected from CurrentModelDirectory)


CurrentModelFolder(path)

Returns or sets the default folder from which models or modules are loaded, and from which relative paths for models or modules are interpreted.

When called with no parameters, returns the current model folder with no side effects.

When called with a text parameter «path», sets the current model folder, interpreting the path provided relative to the previous current model folder. It then returns the full absolute path to the new current model folder.

Examples

CurrentModelFolder( ) → "C:\Documents And Settings\Linda\My Documents"
CurrentModelFolder("C:\Models") → "C:\Models"
CurrentModelFolder( ) → "C:\Models"
CurrentModelFolder("Active") → "C:\Models\Active"

Select File → Add Module.... File dialog opens in C:\Models\Active.

CurrentModelFolder("..\Old") → "C:\Models\Old"
CurrentModelFolder("[My Documents]") → "C:\Documents And Settings\Linda\My Documents"

More details

Note
When you start Analytica, the CurrentModelFolder starts out in [My Documents]. When you load a model, it is set to the directory containing the model, and modules with relative path names are loaded relative to that location.

You can change the default start directory by setting a registry setting. Use RegEdit, navigate to the folder HKCU/Software/Lumina Decision Systems/Analytica and create a string value named InitialDir, set to the full file path of the starting directory.

ADE note
CAEngine::OpenModel and CAEngine::AddModule interpret file names as relative to the CurrentModelFolder( ). If you call CurrentModelFolder from typescript prior to calling these, then the full path name does not have to be passed to those functions.

History

CurrentModelFolder is new to Analytica 4.6, but in Analytica 4.5 and earlier the name function is available but named CurrentModelDirectory().

See Also

Comments


You are not allowed to post comments.