Opening a 20-sim model (.emx) stored not in C with scripting

Moderators: Frank, paul, Hiwot, Chris, peter

bendesarts
Posts: 49
Joined: Thu Mar 07, 2013 10:10 am

Opening a 20-sim model (.emx) stored not in C with scripting

Postby bendesarts » Sun Sep 28, 2014 2:49 pm

Hello,

I can open a 20-sim model from a script matlab file with xxsimOpenModel function if the model is located in C: and in the folder didacted for scripting.

But, I didn't manage to open a 20-sim model with scripting if my file is on another harddrive like Z:.

Here the function I use :

xxsimOpenModel( 'Z:\1_Recherche\1_Modèles et simulations\1_Modèles\2_étude BG\6_Folder\3D\1_En cours\Etude énergétique\Filename.emx' );

I have also defined this path in matlab.

Do you have some ideas so as to I can launch with scripting a model which is not located in C: ? Is it possible ? If yes, is there a special process to do this ?

It is probably me who doesn't apply the good method for the moment

Thank you for your help.

paul
Posts: 152
Joined: Mon Sep 19, 2005 2:00 pm
Location: Controllab Products B.V.

Re: Opening a 20-sim model (.emx) stored not in C with scrip

Postby paul » Fri Dec 12, 2014 1:25 pm

Can you tell me what kind of network drive you are using? Is it a DFS or NFS share, etc?

Perhaps it works if you first remember the directory with a pwd, then cd to the directory where the model is, open the model without the path, and cd back to the original directory.
member 20-sim development team

bendesarts
Posts: 49
Joined: Thu Mar 07, 2013 10:10 am

Re: Opening a 20-sim model (.emx) stored not in C with scrip

Postby bendesarts » Sun Dec 28, 2014 3:05 pm

Hello Paul,

Thank you for your help.
I could have started my matlab script for a folder different from the 20simscripting folder thanks to you tips.

Here you can find the matlab code :

Code: Select all

scriptpath = pwd; 
addpath(genpath(scriptpath));
workingpath= fullfile('C:','Users', 'Benjamin','20simscripting','library');
cd(workingpath);
addpath(genpath(workingpath));

... matlab script ...

modelfile = fullfile(scriptpath,'essai.emx');

xxsimOpenModel(modelfile);
xxsimProcessModel();

cd(scriptpath);


The error I made was the fact that I had some word with accent or space in the path where my script was located.


Return to “Editor”

Who is online

Users browsing this forum: No registered users and 2 guests