Manage Shared Definitions

Container entities such as systems, assemblies, and analyses are referred to as definition based entities, along with others such as data sets and templates. These entities are created (called by instances) by an instantiation statement in the MDL that refers to a definition block (see an example below):



Figure 1. MDL statements for instantiating a system definition

Accordingly, it is possible that multiple instances can be instantiated off of the same definition block. Such instances are referred to as shared instances or linked instances. Therefore, two or more systems instantiated by referring to the same definition block are said to be shared systems or linked systems. The sharing can only be established through authoring a model using the text editor in the MDL language. It is not possible currently to create shared instances using the MotionView graphical user interface. An example is show below:



Figure 2.

The graphical user interface of MotionView version 10.0 (and earlier versions) handled shared instances as though they originated from different definitions. Once the model with shared instances was loaded into MotionView and any of the shared instances got modified, the linkage was severed and MotionView saved the instances referring to different definitions. This inherent behavior was removed in version 11.0 and 12.0. In other words - modifying a container entity by adding, deleting, or changing the topology of an entity within resulted in the same change being applicable to the other instance that shared the same definition.

Modifying a system or analysis instance includes adding or deleting an entity to and from the container. It also includes changes to entities that cause the entity to be redefined such as (but not limited to):

  • Changing body, joint, bushing, or force topology (results in the rewriting of the *Body or *xxxJoint statement in MDL; where xxx refers to a revolute, translational, ball, etc. based on the type of joint).
  • Changing graphic topology or its dimension (causes the *Graphic statement to be rewritten in MDL).

Note that the above effect is not applicable for systems and analysis when changing entity properties (such as point coordinates or body mass and inertias) as these properties are managed through a separate *BeginContext block applicable for each instance.

Improved support for shared instances has been provided in the MotionView graphical user interface:

  • The Project Browser indicates the sharing between instances with a separate hand icon appended to the standard icon of the entity. This change is applicable to the following entities: systems, analysis (inline), graphic systems, data sets, templates, command sets, and forms.


    Figure 3.
  • The Project Browser right-click context menu provides the following options (shown in the image above):
    Show Shared Instances Allows you to view information related to shared instances.
    Separate Definition Allows you to stop sharing the definition.

    See the Browser Context-Sensitive Menu topic for additional information.

  • You have the choice of retaining the linkage between shared instances as the individual instances get modified, or to break linkage.
  • A Create a separate definition when modifying a shared instance option is available in the Options Dialog - Build Model (Tools > Options > Build Model) which allows you to control how shared instances should be handled while modifying them.


    Figure 4.

    By default, this option is turned on indicating that any modification to a shared instances will result in a separate definition. Turn this option off in the case where the sharing has to be retained and a change to one instance should be applied to other shared instances also.

With the above changes, it is now possible to control how shared instances will get affected when modifying instances. The above changes are applicable for all definition based entities except assembly and external analysis.

Sharing Assemblies

Similar to sharing systems or an inline analysis, it is possible to create several instances of assemblies that refer to the same definition. However, it is not possible to separate definitions for the assemblies or for any other shared instances within an assembly using the above method. To separate a shared assembly, use the Save As option (available in the right-click context menu) to save the definition to a separate file name.