Difference between revisions of "Filed modules and libraries"
Line 1: | Line 1: | ||
[[Category:Analytica User Guide]] | [[Category:Analytica User Guide]] | ||
− | + | <breadcrumbs>Analytica User Guide > Working with Large Models > {{PAGENAME}}</breadcrumbs> | |
+ | |||
Modules and libraries can be components of a model. If you are building several similar models, | Modules and libraries can be components of a model. If you are building several similar models, | ||
Line 7: | Line 8: | ||
libraries.) To use a module or library in more than one model, create a '''''filed module''''' or '''''filed library'''''. | libraries.) To use a module or library in more than one model, create a '''''filed module''''' or '''''filed library'''''. | ||
− | + | === Creating a filed module or library === | |
To create a filed module or library: | To create a filed module or library: | ||
# Create a module by dragging the module icon from the node palette onto the diagram, and give it a title. | # Create a module by dragging the module icon from the node palette onto the diagram, and give it a title. | ||
Line 15: | Line 16: | ||
# If you want the original model to load the new filed module or library the next time it is opened, save the model using the '''Save''' command. | # If you want the original model to load the new filed module or library the next time it is opened, save the model using the '''Save''' command. | ||
− | + | === Locking a filed module or library === | |
+ | To prevent a filed module or library from being modified, lock it: | ||
# Close the filed module or library, or close Analytica. | # Close the filed module or library, or close Analytica. | ||
# In Windows Explorer, select the filed module or library. | # In Windows Explorer, select the filed module or library. | ||
Line 22: | Line 24: | ||
# Close the '''Properties''' window | # Close the '''Properties''' window | ||
− | + | === Adding a module to a model === | |
+ | To add a filed module to the active model, use the '''[[Add Module dialog]]'''. You can either embed a copy of the module or link to the original of the filed module. | ||
− | + | === Adding library to a model === | |
+ | To add a filed library to the active model, use the '''[[Add Module dialog]]'''. You can either embed a copy of the library or link to the original of the filed library. | ||
When you select '''Add Library''' from the '''File''' menu, the '''Open File''' dialog always opens up to fixed directory, regardless of the current directory settings or previous changes of directories. The | When you select '''Add Library''' from the '''File''' menu, the '''Open File''' dialog always opens up to fixed directory, regardless of the current directory settings or previous changes of directories. The | ||
directory is determined by a registry setting in <code>/Lumina Decision Systems/Analytica/ | directory is determined by a registry setting in <code>/Lumina Decision Systems/Analytica/ | ||
3.0/AddLibraryDir</code>, which is set by the Analytica installer to <code>INSTALLDIR/Libraries</code>. | 3.0/AddLibraryDir</code>, which is set by the Analytica installer to <code>INSTALLDIR/Libraries</code>. | ||
− | + | === Removing a module or library from a model === | |
+ | To remove a filed module or library from a model, first select it. Then, select '''Cut''' or '''Clear''' from the '''Edit''' menu. An embedded copy is deleted; a linked original still exists as a separate file. | ||
− | + | === Saving changes === | |
+ | After you have linked to a filed module or library, the '''Save''' command saves every filed module and library that has changed, as well as the model containing them, in their corresponding files. The '''Save As''' and '''Save A Copy''' In commands save only the active (topmost window’s) model, filed module or filed library. | ||
− | ==See Also== | + | == See Also == |
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5 | {| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5 | ||
|- style="text-align: center" | |- style="text-align: center" | ||
− | | | + | | <footer>Invalid variables / {{PAGENAME}} / Adding a module or library</footer> |
|} | |} |
Revision as of 19:49, 26 October 2015
Modules and libraries can be components of a model. If you are building several similar models,
or if you are building a large model composed of similar components, you can create modules
and libraries for reuse. (See Building Functions and Libraries for details about
libraries.) To use a module or library in more than one model, create a filed module or filed library.
Creating a filed module or library
To create a filed module or library:
- Create a module by dragging the module icon from the node palette onto the diagram, and give it a title.
- Create functions and variables in the module, or create them elsewhere and move them into the module.
- Change the class of the module to Module
or Library
- The Save As dialog appears. Give the filed module or library a name and save it.
- If you want the original model to load the new filed module or library the next time it is opened, save the model using the Save command.
Locking a filed module or library
To prevent a filed module or library from being modified, lock it:
- Close the filed module or library, or close Analytica.
- In Windows Explorer, select the filed module or library.
- Select Properties from the File menu.
- Check the Read-only checkbox.
- Close the Properties window
Adding a module to a model
To add a filed module to the active model, use the Add Module dialog. You can either embed a copy of the module or link to the original of the filed module.
Adding library to a model
To add a filed library to the active model, use the Add Module dialog. You can either embed a copy of the library or link to the original of the filed library.
When you select Add Library from the File menu, the Open File dialog always opens up to fixed directory, regardless of the current directory settings or previous changes of directories. The
directory is determined by a registry setting in /Lumina Decision Systems/Analytica/
3.0/AddLibraryDir
, which is set by the Analytica installer to INSTALLDIR/Libraries
.
Removing a module or library from a model
To remove a filed module or library from a model, first select it. Then, select Cut or Clear from the Edit menu. An embedded copy is deleted; a linked original still exists as a separate file.
Saving changes
After you have linked to a filed module or library, the Save command saves every filed module and library that has changed, as well as the model containing them, in their corresponding files. The Save As and Save A Copy In commands save only the active (topmost window’s) model, filed module or filed library.
Enable comment auto-refresher