Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.1 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> Xcos > Fonctions utilitaires Scilab > getModelicaPath

getModelicaPath

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

Calling Sequence

[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 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 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
%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()
Report an issue
<< create_palette Fonctions utilitaires Scilab importXcosDiagram >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:36:47 CEST 2013