MotionView User's Guide

Managing Shared Definitions

Managing Shared Definitions

Previous topic Next topic No expanding text in this topic  

Managing Shared Definitions

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Container entities such as Systems, Assembly, and Analysis are referred to as definition based entities, along with the others such as DataSets and Templates.  These entities are created (called as instances) by an instantiation statement in the MDL that refers to a definition block (see an example below):

managing_shared_def_mdl_example_mv

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:

managing_shared_def_mdl_example2_mv

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.

Starting with version 12.0.110, 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, DataSets, Templates, CommandSets, and Forms.

managing_shared_def_browser_example_mv

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.

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.

managing_shared_def_options_dialog_mv

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 Assembly

Similar to sharing Systems or Inline Analysis, it is possible to create several instances of Assembly 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.