Command Line Modelio

To run Modelio in command line, you must execute:

  • In Windows:
    The executable file modelio.exe located in Modelio’s installation folder.

  • In Linux:
    The executable file modelio.sh located in Modelio’s installation folder.

  • In MacOSX:
    The executable file modelio.sh located in the Contents/MacOS subdirectory of Modelio’s installation folder.

In this page, we will refer to Modelio’s executable full path (for example: C:\Program Files\Modelio Open Source 4.1\modelio.exe ), as ${MODELIO_EXE}.

Options list

Modelio comes with several command line options:

-workspace workspacePath
Indicates the workspace to use.
For example:

  • Open Modelio in using C:\Users\user\myWorkspace directory as workspace .
    ${MODELIO_EXE} -workspace C:\Users\user\myWorkspace

-create projectName
Creates a project named projectName in the workspace. Must not be used at the same time as "-project".
For example:

  • Create a new project named "MyNewProject":
    ${MODELIO_EXE} -create MyNewProject

  • Create a new project named "AnotherNewProject" in the C:\Users\user\myWorkspace workspace :
    ${MODELIO_EXE} -workspace C:\Users\user\myWorkspace -create MyNewProject

-template templateName
This option must be used with "-create". It Indicates a project type to use when creating a new project.
templateName can be a full path to the project type (extension file is .template) or only a project type name. In the latter case, the project type file must be present in the "templates" directory of the Modelio installation.
For example:

  • Create a new project named "MyProject" using the "UML" project type which is present in the Modelio installation: ${MODELIO_EXE}
    ${MODELIO_EXE} -create MyProject -template UML

  • Create a new project named "MyNewProject" using the C:\Users\user\myTemplate.template file as project type:
    ${MODELIO_EXE} -create*
    MyNewProject -template* C:\Users\user\myTemplate.template

-project projectName or -open projectName
Indicates which project to open. Must not be used at the same time as "-create".
For example:

  • Open a Modelio project named "MyProject":
    ${MODELIO_EXE} -project MyProject

  • Open a Modelio project named "AnotherProject" in the C:\Users\user\myWorkspace workspace :
    ${MODELIO_EXE} -workspace C:\Users\user\myWorkspace -project AnotherProject

-join ModelioServer/projectID

Join the project which ID is projectID, from the server ModelioServer

Needs to specify a login and a password, see example below.

-muser login -mpassword password
Use this credentials when opening or joining a Modelio Server project.
For example:

  • Join a Modelio Server project as "user1" with "user1_password".
    ${MODELIO_EXE} -join https://modelioserver.mycompany.com/12_ -muser user1 -mpassword user1_password

  • Open a Modelio Server project named "MyProject" as "user1" with "user1_password".
    ${MODELIO_EXE} -project MyProject -muser user1 -mpassword user1_password

-batch scriptFile
Indicates a Jython script to launch automatically after opening a project. Modelio will close automatically after script execution. Must be used with "-project" or "-create".
For example:

  • Open the "MyProject" project and run the "C:\Users\user\myscript.py" Jython script on it.
    ${MODELIO_EXE} -project MyProject -batch C:\Users\user\myscript.py

  • Create the project "MyNewProject" and run the "C:\Users\user\myscript.py" Jython script on it.
    ${MODELIO_EXE} -create MyNewProject -batch C:\Users\user\myscript.py

-param key val
Set the key variable with the val value. This variable is available in the jython script.
For example:

  • Run the " C:\Users\user\myscript.py " Jython script on the "MyProject" project and set two variables "myVar1" and "myVar2" and having respectively the values "the value1" and "the value2":
    ${MODELIO_EXE} -project MyProject -batch C:\Users\user\myscript.py -param myVar1 " the value1 " -param myVar2 " the value2 "