Wizards offer an easy and convenient way to assemble and analyze models comprising of systems stored in a library with few clicks.

The Assembly Wizard helps to assemble a model by selecting the combination of required systems. The Task Wizard helps to attach an analysis or an event to the model assembled using the Assembly Wizard.

Accessing the Wizards

The wizards can be accessed from the Assembly ribbon through the Wizards group.
Figure 1. Wizards Group in the Assembly Ribbon

Assembly Wizard

Click on the Assemble icon to display the Assembly Wizard.
Figure 2. Assembly Wizard Dialog

The Assembly Wizard dialog consists of a series of pages where you can make selections for systems necessary to assemble the model.
Figure 3. Assembly Wizard Dialog System Selections

Click on Next to navigate to the next page until the last page shows Finish.
Figure 4. Assembly Wizard Dialog Last Panel

Upon finish, the selected systems are imported into an empty MotionView session.

There is also an option to select Attachments before Finish.
Figure 5. Attachment Wizard Dialog

Note: The Attachment option would be active if there were more than one choice available for any system. The attachments can also be changed through the Attachments Wizard (drop-down under the Wizards group) after the model has been built.

Once the systems are imported, the model can be further edited like any other regular MotionView model. Upon saving, the wizard choices are saved to the MDL.

Add an Analysis

Once a model is built using the Assembly Wizard, an analysis can be added to the model using the Task Wizard .
Figure 6. Task Wizard Dialog

The analysis may present Forms, if existing, for inputs that configure the analysis. Upon Finish, the analysis is imported into the model.
Note: Multiple analyses can be added to a model invoking the Task Wizard each time.

Wizard Path

You can create wizard libraries and register them in MotionView. Once registered, you can set any library as current for modeling and events using the Settings dialog.
Figure 7. Wizard Settings

Refer to Register the Wizard Files described later in this section.

Example Wizard

An Example Wizard is made available in MotionView. Using the example, you can learn about creating a library and authoring the wizards.
Note: The models are only for demonstrating the wizard feature. The accuracy of the models, their working as such is not guaranteed.

The following section describes the general process that can be followed to create one’s own wizard library considering the models in the Example Wizard.

Create Your Own Wizard Library

Building a library and using it with the wizards offers several benefits:
  • Capture product and testing knowledge into a library of systems and analyses.
  • Offers ease of assembling model variants to a large group of users.
  • Provides easy customization of assembling models with very minimal knowledge of programming.
  • Saves repetition of model building with the same topology.
Wizard libraries are particularly useful in putting together a model that comes in multiple variants, permutation, and combination of systems. An expert MotionView user can build the library and the assembly logic which can then be shared with several common users with limited knowledge of MotionView and the MDL Language.

Steps to Create a Wizard Library

  1. Build model/s and events.
    1. The model could be built interactively using the graphical user interface and/or editing the MDL in a text editor. Familiarity with the MDL language would be useful.
    2. While building the model, organize the model into hierarchical systems.
    3. It is recommended to create the systems in a modular way. That means, each system is self-contained. Any reference to an entity external to the system is managed through Attachments.
    4. Define parametric relations between entities as necessary. It is beneficial to create either a dataset or a set of data members at the system level that comprise of datatypes - Real, Integer, Boolean, Options, Strings and Filenames. These data members can form the key parameters that configure a system without the need to edit the child entities of the system.
    5. A Form can be used to organize the data members in a row-column tabular form. Forms also support adding an image that can describe the system parameters.
    6. Similarly, organize events or test cases applied to the model into Analyses.
    7. Solve the model and create plots and animations as needed. Save the session to a Report template (*.tpl).
  2. Save the system and analyses definitions individually to form a library with a directory.
    1. Systems and Analyses can be exported into an MDL definition.
    2. Include data during export. They will form as the default values for the entity properties.
  3. Author the Assembly wizard file that contains the model building logic using the MDL wizard language.
  4. Author the Task wizard file that contains the events or analyses associated with the models using the MDL Wizard Language.
  5. Register the wizard files using the preference file statements to link with the Wizard dialog.

These steps are well elaborated further using the Example Wizard.

Build Model/s and Events

The Example Wizard provides two models: Link and Slider Crank.
Link Model
The following image shows the system arrangement of the Link model.
Figure 8. Link Model

The model is arranged in two systems: Link system and Pivot system.

Link system consists of:
  1. Data members Length and Angle (added using the Properties section in the Entity Editor).
  2. Point link end1 is an independent point.
  3. Marker Reference at point link end1. Its orientation is free.
  4. Point link end2 is defined in cylindrical coordinates in the Reference marker frame with the Length and Angle as parameters using the loc_cylindrical function. The point is located on the XY plane of the marker.
  5. Point link CG is a point between points link end1 and link end2.
  6. Body link.
  7. Graphic Cylinder Link for the body link defined between end points.
  8. Graphic End 2 Cylinder at link end 2.

Pivot System

The purpose for the pivot system is to constrain the link to Ground Body at one of the ends. It is desired to provide more than one variation (hinge or ball) to the pivot system while assembling the link model using the wizard.
Pivot Hinge
In this system, the link will be constrained using a revolute joint at the Reference marker origin and oriented along its Z axis. Since the link body and Reference marker are in a different system (link), to maintain modularity, these entities are input to the pivot system as attachments.
Figure 9. Link Model - Pivot System (Hinge)

The system consists of:
  1. Attachments – Ref (Marker) and Pendulum Body (Body).
  2. Joint Pivot – Revolute joint between the attachment Pendulum Body & Ground Body at Ref marker’s origin along Ref marker's Z axis.
    Note: Origin and alignment axis must be resolved using Advanced selection to refer to the attachment’s child attributes.
  3. Graphics for the joint – graphic’s body, origin and direction refer to the joint Pivot attributes.
Pivot Ball
The pivot ball is similarly constructed as the hinge system above, except the type of joint used is a Ball joint instead of revolute. The system can either be created in the same model or a separate model can be created.
Figure 10. Link Model - Pivot System (Ball)

Rotation Analysis
Imposes a constant velocity motion on the revolute joint of the Pivot Hinge. When building the wizard, this analysis will only be available when the Pivot system is of type Hinge.
Figure 11. Link Model - Rotation Analysis

The analysis contains:
  1. Attachment Joint Attachment to apply motion.
  2. Dataset Input for speed of rotation.
  3. Form that links to the dataset (Form can be added by editing the MDL).
  4. Motion Rotation. The value in the Input dataset is parametrically linked here.
    Figure 12.

  5. Outputs.
  6. Report – A report that plots the rotation speed in HyperGraph and animates the results in HyperView. The report refers to a definition in a report template and can be created by the following method.
Solve the model and create plots and animation on a separate page in the session.
Figure 13. Results Plot for Rotation Analysis

Save the session (File > Session > Save As) as a report template.

Insert a *Report statement in the analysis definition block of the model MDL using a text editor. For every solver run, the report is accessible through View > Reports dialog in the Analyze ribbon.
Oscillation Analysis
Adds an extra mass to the link and lets the link oscillate under gravity.
Figure 14. Link Model - Oscillation Analysis

This analysis contains:
  1. Attachment Point Attachment and Link Attachment (Body) to add extra mass at the link end.
  2. Body and Graphics Extra mass.
  3. Dataset Input for mass of Extra Mass.
  4. Form that links to the dataset (Form can be added by editing the MDL).
  5. Output to measure oscillation.
  6. Report – A report definition that plots the oscillation of the mass in HyperGraph and animates the results in HyperView.
Slider Crank Model
The slider crank model is also built following the same process above. The model is arranged in two systems.
Slider Crank System consists of:
  1. Dataset Cyl_configuration with data members Crank_ang_about_Global_X, Crank_length, Conrod_length, and Piston_dia.
  2. Bodies – Piston, ConnectingRod and Crank with graphics.
  3. Points to define graphics on bodies. The points are parametrically linked to the dataset members.
  4. Joints.
  5. Marker Combustion_ref on piston to apply force on Piston.
  6. Solver variable Crank Angle to measure the crank angle between 0 and 720 deg.
  7. Outputs.
Flywheel system consists of:
Figure 15. Slider Crank Model

  1. Attachments – Crank_shaft, Crank Center, and Connecting Point.
  2. Flywheel body with graphic.
  3. Joint – Fixed to Crank_shaft at Connecting Point.
  4. Flywheel CG at Crank_shaft.
Analysis – Force on slider
Figure 16. Slider Crank Model - Analysis Force on Slider

  1. Attachments – Crank Angle (SolverVariable), Crank Joint (Joint), Piston Attachment (Body), Force marker ref (Marker).
  2. Curve – Piston Force v/s Crank Angle.
  3. Piston Force – on Piston Attachment at Force marker ref-origin. Force is applied using the Curve Piston Force v/s Crank Angle with Crank Angle as the independent variable.
  4. Motion – Rotational Velocity Motion on Crank Joint.
  5. Output – Piston force on Piston Attachment.
  6. Report – A report that plots the Force on the piston against the Crank Angle along with an animation window by the side.
Figure 17. Results Plot for Force on Slider

Saving System and Analyses Definitions into a Library

Once the models simulate and provide results as expected, save the system and analyses definitions into a directory structure to form a library, either by:
  1. Selecting the systems (or analysis) individually in the browser and use the File > Save As > MDL Definition option.


  2. Copy the *DefineSystem() (or *DefineAnalysis) - *EndDefine() blocks into a separate file and saving it to an mdl file. Any reference by an entity in the system to another definition may also require definition block such as *DefineGraphic() or *DefineDataset() to be copied.

Also copy the report tpl files referred to by *Report into the library. Ensure that the path in the *Report is in relation to the analysis definition file. The files associated with the Example Wizard are located at ~install\hwdesktop\hw\mdl\mdllib\Example_wizard.

Author the Assembly Wizard File

The assembly wizard file drives the Assembly Wizard dialog and is written in the MotionView Wizard language. Refer to assembly.wzd in the Example Wizard folder to learn how the Assembly Wizard is authored.
  1. Each panel that appears with options such as radio buttons or drop-down choices are defined within a *BeginPanel() - *EndPanel() block.
  2. *Title() can be used to specify a title for the panel.
  3. *BeginRadioGroup() - *EndGroup() defines a radio choice within the panel.
    Figure 18. Assembly Wizard Statements to Dialog Mapping

  4. Use the *if-elseif-else-endif() block to branch out further system selection based on previous radio or system selections.
    Figure 19. Assembly Wizard Statements to Dialog Mapping - Conditional Branching

  5. *BeginSystemGroup() - *EndGroup() is used to define a system selection choice. This appears as a drop-down option in the dialog.
    1. *BeginSystem() - *EndSystem() block offers a choice of system selection. There could be more than one such block within the group.
      • *Attach offers attachment choice. An attachment to a system may have several attachment choices. These choices will appear in the Attachment Wizard. If Attachment Wizard is not accessed, the first in the list of *Attach choices for an attachment will be considered as default.
    2. *System can be used to instantiate a system which does not have any attachments.
    3. *System(“None”) can also be a choice of “No system”.
  6. *Message can be used to have a message at the bottom of the panel.
    1. Only one *Message is allowed on a panel.
    2. Message should appear in a single line entry. Use /n to display the message in multiple lines in the dialog.

The wizard can contain several BeginPanel blocks. At the finish, MotionView will instantiate the systems that are selected under each panel. It will also resolve the attachments.

The wizard selection choices are also saved in the model file.

Author the Task Wizard File

The Task Wizard helps to add one or more analysis tasks to an existing model built using the Assembly Wizard. Refer to task.wzd in the Example Wizard folder to learn how the Task Wizard is authored.
  1. The tasks are listed using *BeginTaskGroup() within one *BeginPanel() block.
  2. Use *if-elseif-else-endif block to customize the task group based on model or system selections. The if block can also be used within *BeginTaskGroup() to customize the tasks.
    Figure 20. Task Wizard Statements to Dialog Mapping

  3. Each task is defined using a *BeginTask() block that refers to an analysis definition within a definition file (mdl). Attachments to the analysis are also passed as arguments in this block.
  4. A *BeginForm() can be used to bring up a form that is defined in the analysis once clicking Finish.
    Figure 21. Form in Task Wizard

Register the Wizard Files

Once all the system definitions and wizard files are ready, it is time to register the wizard files, so that the wizards can be invoked through the graphical user interface.

The following information is needed for registering in a library:
Assembly Wizard file File containing Assembly Wizard code in the MDL Wizard language.
Task Wizard file File containing Task Wizard code in the MDL Wizard language.
MDL standard include file This file is read at the start up of MotionView. This file can contain any model defaults in the MDL language. It is recommended to use the std_inc.mdl which is part of standard include. If any additional defaults have to be provided, please include the std_inc.mdl using the *Include() statement and then followed by other statements.
Wizard library directory Folder containing the system, analysis, report and any other reference files used in the wizards.
Report log file Reports in the model are logged during the runs and are stored in this file. Information from this file appears in the View > Reports dialog in the Analyze ribbon that can be used to plot automated reports for the run.
The Wizard library can be registered with MotionView through the following ways such that the library is available when MotionView is launched.
  1. User/Custom library – in the Settings dialog of the Wizard group in the Assembly ribbon.
    Figure 22. Wizard Settings

    This option allows registering only one library.

  2. Using Preference file statements

    Use a preference file (*.mvw).

    The preference file can be registered and loaded from the menu File > Load > Preference File (*.mvw).

    The file can contain statements as shown below:
    *Id("MotionView v12.0")
    *RegisterAssemblyWizardFile(MyLibrary,"C:/Libraries/My_Library/assembly.wzd" )
    *RegisterTaskWizardFile(MyLibrary, "C:/Libraries/My_Library/task.wzd" )
    *RegisterWizardLibDir(MyLibrary, "C:/Libraries/My_Library/" )
    *RegisterMdlStdIncFile(MyLibrary,getenv("ALTAIR_HOME")+"/hw/mdl/mdllib/std_inc.mdl"} )

    The first argument in the *Register statement refers to the name of the library. More than one library can be registered using one or more preference files.

    See Preference Files for additional information.