.OpenModelica.Scripting.loadModelica3D

Information

Usage

Modelica3D requires some changes to the standard ModelicaServices in order to work correctly. These changes will make your MultiBody models unable to simulate because they need an object declared as:

inner ModelicaServices.Modelica3D.Controller m3d_control

Example session:

loadModelica3D();getErrorString();
loadString("model DoublePendulum
  extends Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum;
  inner ModelicaServices.Modelica3D.Controller m3d_control;
end DoublePendulum;");getErrorString();
system("python " + getInstallationDirectoryPath() + "/lib/omlibrary-modelica3d/osg-gtk/dbus-server.py &");getErrorString();
simulate(DoublePendulum);getErrorString();

This API call will load the modified ModelicaServices 3.2.1 so Modelica3D runs. You can also simply call loadModel(ModelicaServices,{"3.2.1 modelica3d"});

You will also need to start an m3d backend to render the results. We hid them in $OPENMODELICAHOME/lib/omlibrary-modelica3d/osg-gtk/dbus-server.py (or blender2.59).

For more information and example models, visit the Modelica3D wiki.

Interface

function loadModelica3D
  input String version = "3.2.1";
  output Boolean status;
end loadModelica3D;

Generated at 2024-12-21T19:25:56Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos