DMU Kinematics Simulator

Solving a Mechanism for a Command Set


This macro shows you how to retrieve motion for a moving part of a mechanism, after applying new command values. The macro assumes that a CATProduct has been loaded, with one mechanism having at least two commands.

After running the macro, the moving part has been moved to its position with the new command values.

 

CAAKiiMechanismSolve is launched in CATIA [1]. You need to previously open the provided document.

CAAKiiMechanismSolve.CATScript is located in the CAAScdKiiUseCases module. Execute macro (Windows only).

 

CAAKiiMechanismSolve includes five steps:

  1. Prolog
  2. Retrieve a moving part
  3. Retrieve the current command values
  4. Solve for other command values
  5. Retrieve motion after solving and apply it

Prolog

Some variables are defined:

 dValcmd: array of double to contain the command values.

 dMotion: array of double to contain the part's motion as a 3x4 matrix.

 oRootProduct: it represents the root of the product graph.

 cTheMechanisms: it represents the mechanism collection for this product. This collection is retrieved using the GetTechnologicalObject method, with the string "Mechanisms".

 oFirstMechanism: it represents the first mechanism in the collection.

 

Retrieve the number of moving parts, and the first one

The number of parts in a mechanism is obtained through the NbProducts property.

The parts in a mechanism are obtained through the GetProduct function, using an index ranging from 1 to NbProducts .

 

Retrieve the current command values for the mechanism

The current command values of a mechanism are obtained as an array of double, through the GetCommandValues function.

The array to contain the command values must be declared with a dimension equal to the NbCommands property of the mechanism.

 

Solve for other command values

The command values array can be changed to other values using standard operations.

The PutCommandValues method allows to trigger solver operation for the new command values.

 

Retrieve motion after solving and apply it

The transformation for a moving part is obtained using the GetProductMotion method. The moving part given as input must be a product given by the GetProduct function.

The transformation is a 3x4 matrix, coherent with expectations from the Apply method of the Move object.

[Top]


In Short

This use case has shown how to solve a mechanism, retrieve the motion for one part, and apply it. Specifically, it has illustrated how to :

You can derive a macro to apply the motion to all parts of a mechanism.However, solving a mechanism after applying motion to the parts is not supported in this release.

[Top]


References

[1] Replaying a macro
[2] DMU Kinematics automation objects

[Top]


DMU Navigator Home DMU Space Analysis Home DMU Kinematics Simulation Home

Copyright © 2001, Dassault Systèmes. All rights reserved.