Difference between revisions of "Using Add Module... to import a Model file"

Line 9: Line 9:
 
Answering Yes reads in the system variable settings from the imported file, answering no leaves your current system variable settings in tact.
 
Answering Yes reads in the system variable settings from the imported file, answering no leaves your current system variable settings in tact.
  
If you are linking (rather than embedding), the model will remember your answer.  However, beware that a linked file may be saved if it is dirtied in any way, thus causing the system variables in the file to be replaced.   
+
If you are linking (rather than embedding), the model will remember your answer.  However, beware that a linked file may be saved if it is dirtied in any way, thus causing the system variables in the file to be replaced.  Also, when linking, the checkbox at the bottom appears, giving you the option of converting the top-level object in the file being linked to a linked module.  Note that this will cause the system variable settings to be lost when the model is saved.
  
 
In general, if you intend a file to be shared between models, don't use a Model class.  Change the class of the top-level object to LinkModule or LinkLibrary.
 
In general, if you intend a file to be shared between models, don't use a Model class.  Change the class of the top-level object to LinkModule or LinkLibrary.

Revision as of 22:12, 20 October 2009

The top-level object in an Analytica (*.ana) file may be a Model object, a Linked Module oblect, or a Linked Library object. Linked Modules and Linked Libraries are meant to be imported into models and re-used, while a Model is intended to serve as the top-level object. Model files differ from linked module or linked library files in that in addition to storing the module and contained objects, the Model file also stores system variables (such as Time and SampleSize) and preferences.

If you use Add Module... to add a Model file to an existing model, the system variable settings (Time, SampleSize, and preferences) that are in that file are normally read from the file and replace the current settings.

In Analytica 4.2.2 and later, you will be asked:

Add Model as Module.png

Answering Yes reads in the system variable settings from the imported file, answering no leaves your current system variable settings in tact.

If you are linking (rather than embedding), the model will remember your answer. However, beware that a linked file may be saved if it is dirtied in any way, thus causing the system variables in the file to be replaced. Also, when linking, the checkbox at the bottom appears, giving you the option of converting the top-level object in the file being linked to a linked module. Note that this will cause the system variable settings to be lost when the model is saved.

In general, if you intend a file to be shared between models, don't use a Model class. Change the class of the top-level object to LinkModule or LinkLibrary.

See Also

Comments


You are not allowed to post comments.