Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語 -
Справка Scilab >> Xcos > Scilab Utilities Functions > getModelicaPath

getModelicaPath

Get the Modelica directory path needed by Xcos diagram containing Modelica blocks

Syntax

[modelica_path, modelica_directory] = getModelicaPath()

Description

This function is used to know where are the Modelica files used to define Xcos Modelica blocks.

If the user wants to define his own Modelica blocks, Modelica files describing the blocks must be indicated. The variable %MODELICA_USER_LIBS has to be declared as global before launching Xcos.

Arguments

  • modelica_path: a string providing the absolute path of the Modelica directory containing the defining blocks Modelica files.

  • modelica_directory: a string providing the name of the Modelica directory where are created the files needed for the simulation.

Example

// Get the current Modelica path and directory
[modelica_path, modelica_directory] = getModelicaPath()

// To define user's Modelica blocks
// path of the directory containing the user's Modelica files
// It has to be global to be accessed from Atoms toolbox
global %MODELICA_USER_LIBS
%MODELICA_USER_LIBS = SCI + "/modules/xcos/modelica_library";

// Launch Xcos
xcos();
// Load the diagram with Modelica blocks

[modelica_path, modelica_directory] = getModelicaPath()

// To define user's Modelica blocks
// paths of the directory containing the user's Modelica files
%MODELICA_USER_LIBS = [%MODELICA_USER_LIBS , SCI + "/modules/xcos/my_modelica_blocks/Electrical_network"];

// Launch Xcos
xcos();
// Load the diagram with Modelica blocks

[modelica_path, modelica_directory] = getModelicaPath()

See also

  • MODELICA_USER_LIBS: specify the paths of the directories containing the Modelica class definition files

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:13:36 CET 2017