Difference between revisions of "CurrentModelFolder"

(category file system functions)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:System Functions]]
 
[[Category:System Functions]]
 +
[[Category:File system functions]]
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
Returns or sets the default directory 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 directory with no side effects.
+
==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 a text parameter, sets the current model directory, interpreting the path provided relative to the previous current model directory.  It then returns the full absolute path to the new current model directory.
+
When called with no parameters, returns the current model folder with no side effects.
  
= Examples =
+
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.
  
CurrentModelDirectory( ) &rarr; "C:\Documents And Settings\Linda\My Documents"
+
== Examples ==
CurrentModelDirectory( "C:\Models" ) &rarr; "C:\Models"
+
:<code>CurrentModelFolder( ) &rarr; "C:\Documents And Settings\Linda\My Documents"</code>
CurrentModelDirectory( ) &rarr; "C:\Models"
+
:<code>CurrentModelFolder("C:\Models") &rarr; "C:\Models"</code>
CurrentModelDirectory( "Active" ) &rarr; "C:\Models\Active"
+
:<code>CurrentModelFolder( ) &rarr; "C:\Models"</code>
 +
:<code>CurrentModelFolder("Active") &rarr; "C:\Models\Active"</code>
  
Select '''File->Add Module...'''.  File dialog opens in C:\Models\Active.
+
Select '''File &rarr; Add Module...'''.  File dialog opens in <code>C:\Models\Active</code>.
  
CurrentModelDirectory( "..\Old" ) &rarr; "C:\Models\Old"
+
:<code>CurrentModelFolder("..\Old") &rarr; "C:\Models\Old"</code>
CurrentModelDirectory( "[My Documents]" ) &rarr; "C:\Documents And Settings\Linda\My Documents"
+
:<code>CurrentModelFolder("[My Documents]") &rarr; "C:\Documents And Settings\Linda\My Documents"</code>
  
= Note =
+
==More details==
 
+
<tip title="Note"> When you start Analytica, the [[CurrentModelFolder]] starts out in <code>[My Documents]</code>.  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.
When you start Analytica, the CurrentModelDirectory 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  
 
You can change the default start directory by setting a registry setting.  Use RegEdit, navigate to the folder  
HKCU/Software/Lumina Decision Systems/Analytica  
+
<code>HKCU/Software/Lumina Decision Systems/Analytica</code>
and create a string value named InitialDir, set to the full file path of the starting directory.
+
and create a string value named <code>InitialDir</code>, set to the full file path of the starting directory.
 
+
</tip>
== ADE note ==
 
  
CAEngine::OpenModel and CAEngine::AddModule interpret file names as relative to the CurrentModelDirectory( ).  If you call CurrentModelDirectory from typescript prior to calling these, then the full path name does not have to be passed to those functions.
+
<tip title ="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.
 +
</tip>
  
= See Also =
+
==History==
 +
[[CurrentModelFolder]] is new to [[Analytica 4.6]], but in [[Analytica 4.5]] and earlier the name function is available but named [[CurrentModelDirectory]]().
  
* [[CurrentDataDirectory]]
+
== See Also ==
 +
* [[CurrentDataFolder]]
 +
* [[Configuring Personalized Defaults]]

Latest revision as of 01:11, 4 March 2021


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.