General Constraints

Use the General Constraints tool to create a generic expression based constraint.

Create General Constraints

Use the General Constraints panel to create a generic expression based constraint.

  1. From the Project Browser, select the system to which the general constraint entity is to be added.
  2. Right-click on a system in the Project Browser and select Add > Constraint > ConstraintGeneral from the context menu.
    Right-click on a general constraint folder in the Project Browser and select Add GeneralConstraint from the context menu.
    Right-click the GeneralConstraint button on the Constraint toolbar.
    The Add GeneralConstraint dialog is displayed.
  3. Specify a label and variable name.
    By default, variables names of entities in MotionView follow a certain convention. For example, all general constraint entities have a variable name starting with “gcon_”. This is the recommended convention to follow when building models in MotionView since it has many advantages in model editing and model manipulation.
  4. Click OK to close the window or Apply to continue creating entities.
    Once a general constraint entity has been added to the model, the panel for the constraint will automatically be displayed in the panel area.

Edit General Constraints

  1. If the General Constraints panel is not currently displayed, select the desired general constraint by clicking on it in the Project Browser or in the modeling window.
    The General Constraints panel is automatically displayed.
  2. Enter a solver expression.
    The expression may involve position, velocity, or any other general measure of the system.
  3. Alternatively, activate the User-defined properties check box, click the newly created User-Defined tab, and define the user subroutine.
    1. Provide an expression with the USER solver function with parameters being passed to the user subroutine.
    2. Alternatively, activate the Use local file and function name check box to specify a local file where the subroutine code can be accessed by the solver.
      If this option is not specified, MotionSolve will search for a subroutine following its user subroutine loading rules.
    3. Select a function type from the drop-down menu.
    4. Select the local file for the subroutine.
      The type of file to be specified will depend on the selected function type. For example, if DLL/SO is selected, you can specify a file with a .dll extension (for Windows) or an .so extension (for Linux).
    5. Specify the function name in the subroutine that defines the entity, or accept the default name provided by MotionView.