Generate a Modelica Model from a Kinematic Mechanism, Using a Command
You can generate a Modelica model from a kinematic mechanism of a physical product, using a command.
Context: The following options are only available when using the command:
- Creating 3D representations of the shapes in VRML format.
- Generating a World component and connect it to fixed parts if the physical model contains published axes.
-
Open a physical product containing a mechanism:
-
From the top bar, search for the physical product.
For more information about searching, see 3DEXPERIENCE Platform:Top Bar.
-
To open both the physical and logical parts of the product, right-click it in the
Search Results
panel and select Open With > Smart Open in RFLP
.
The product is opened in authoring mode. -
Analyze and compute the masses and inertia of the 3D parts. For more information,
see Managing Masses and Inertia.
Note: If you only want to update mass and inertia on parts before translation, skip this step.
-
From the top bar, search for the physical product.
-
To store the generated model, create a new Dymola Behavior library, with the name
MyGeneratedModels. See Create a Dymola Behavior Library.
- You enter the Dymola Behavior Modeling app in a new tab.
- A Dymola Behavior Library MyGeneratedModels is created in the new tab.
Note: To work more comfortably between the apps, make both tabs visible on the screen. -
From the Behavior Tools section of the action bar, click Generate from Kinematic
to generate the Modelica model.
The Generate from Kinematic dialog box appears.Note: If you already have an active model that is generated by this command, the dialog is prefilled with the setup used for generating this model. -
Select the mechanism:
- Click the Mechanism: box.
- In the tab where the mechanical model is seen, in the tree, click any joint or command of the mechanism to be used for Modelica model generation.
The name of the mechanism appears in the Mechanism: box. -
Select the parent class where the generated model should be inserted:
- Click the Insert In: box.
- In the Dymola Behavior Modeling app, from the Package Browser, or from the tree, click the package where you want to insert the Modelica representation.
- Click the Output class name: box and enter the name of the Modelica model to be created. In this scenario, enter MyGeneratedCylinder.
- Optional:
You can specify more options by clicking More:
Option Description Generate VRML from parts Generates 3D representations of the shapes, in VRML format. Note: If cleared, the generated model includes links to the initial 3D physical model, so it can be animated from the results. By default, this option is cleared.Update mass and inertia on parts before translation Updates mass and inertia on parts before translation. Note: By default, this option is cleared.Include motors Includes motors attached to commands. Note: By default, this option is cleared. In this scenario, keep this option cleared.Always generate a world component Generates a World component and connects it to fixed parts, even if the physical model contains published axes by activating. Note: If not activated, the World model is only generated when the physical model does not contain any published axes. By default, this option is cleared. In this scenario, keep this option cleared.Rebuild at PLMUpdate Rebuilds the model when performing any general update command, that is, any of the commands Update or Update Assistant. Note: By default, this option is activated. A reason for clearing this option can be if you want to compare two alternatives of a model without risking that an update command updates the wrong model.Joint boundary kind Defines how to interpret limiters on revolute, prismatic, and cylindrical joints when generating the Modelica representation. Select any of: - Warning: When the joint reaches the limit value, a warning appears and the simulation continues.
- Error: When the joint reaches the limit value, an error appears and the simulation stops.
- Limiter: A Modelica limiter is inserted between the flanges of the Modelica joint, limiting the joint´s movements between the defined limits.
-
Click OK to start the model generation.
The following is created under the selected target package MyGeneratedModels:
- A class
InternalGenerated that contains the generated model
MyGeneratedCylinder. Note: This class is locked, you should not edit this class.
- An extended class
MyGeneratedCylinder. Note: This is the class that you can edit, for example to extend the model or replace components.
Notes:- If required, the geometries of the parts involved in the mechanism are loaded.
- The root physical model containing the mechanism you selected is set to authoring mode to retrieve some data from that model.
- If you have already loaded the physical product in the session, for example, you have opened it in a tab, only the relevant parts are loaded, not the full product, to not alter any filtering you have done. If the product is not in the session, the full product is loaded.
- For the features of the generated classes, for example, handling of mechanism commands, user-driven Point-Curve joints, dress-up pattern, published axes, color animation, replacing of components, see About Generating a Modelica Representation of a Mechanism of a Physical Product.
- If the physical model contains any publications of Knowledgeware parameters
directly under the product that contains the selected mechanism, then the
corresponding Modelica parameters are created in the generated model. Those
Modelica parameters are exposed in Knowledgeware, and a formula is created to
assign the same value as the value of the published parameter.
Important: To keep the link between Knowledgeware parameters in the physical model and the Modelica parameters, select Keep link with selected object from Me > Preferences > Common Preferences > Object Properties > 3D Shape > Infrastructure. For more information, see Native Apps Preferences Guide: 3D Shape Infrastructure.
- A class
InternalGenerated that contains the generated model
MyGeneratedCylinder.
- Test the generated model. For more information, see Testing the Generated Model.