Localizing a
Container
All Containers in a model are either global or local. By default, new Containers that you insert into a model are global. You can localize An action that you can apply to a Container that creates a separate scope for the elements in that Container. a Container An element that acts like a "box" or a "folder" into which other elements can be placed. It can be used to create hierarchical models. in two ways:
- By selecting Localize from the context menu for the element in the graphics pane The primary portion of the GoldSim interface, where the graphical depiction of the model is shown. or a browser An alternative view of a GoldSim model, in which elements are displayed in a tree, and organized either hierarchically, or by type. (accessed via a right-click); or
- By selecting the Localization checkbox on the properties dialog for a Container.
You can recognize a localized container in four ways:
- The triangle in the upper left hand corner of the Container's symbol in the graphics pane is red (instead of blue).
- The icon for the Container in the browsers is a closed box (rather than an open box).
- The default symbol
for the Container in the graphics pane is a closed box (rather than an open
box):
- The tool-tip for a localized container will display "Localized".
In addition, the properties dialog for the Container will indicate that it is localized.
If a Container is localized, then internally it is like a new model: all of the elements within it must have unique names. The elements within the localized Container, however, can share a name with elements outside of the Container.
Note: Like global Containers, localized Containers can be nested, so that a localized Container (referred to here as the parent) can itself contain a localized Container (referred to here as the child). In such a case, the scope The portion of a model from which an element's output can be referenced. You cannot reference an element in a different scope unless that output is specifically exposed. of the parent localized Container does not extend into the child localized Container. Hence, an element ID within the child could be the same as one in some other location within the parent.
In addition to manually localizing a Container, GoldSim will also automatically localize Containers under some circumstances. In particular, whenever you paste a Container from one portion of your model (or one model) to another, GoldSim will automatically localize it if the names of elements inside the pasted Container conflict with those at the location where it is being pasted. (When it does this, it will warn you with a message.)