Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

CombiTable file path

CombiTable file path

I am using a CombiTable2D with tableOnFile.  If I give the full path name it is working fine.  But, if I just give a file name (no path) I get an error that the file can't be found.  I have the data file located in the same directory as my .mo file. 
Where does OpenModelica do a relative path search?  I believe that the working directory is created, on a Mac, in /private/var/folders.....  Would the data file have to be located there?  Is there a way to get OpenModelica to find a data file relative to the current .mo file?

Thanks,

Re: CombiTable file path

There is no good way to use relative paths in Modelica. Instead, use a programmatic way to fetch the absolute path of your package. Instantiate the following model for example:

Code:

model MyPackage

  constant String mp = Modelica.Utilities.Files.loadResource("modelica://MyPackage");
  annotation(uses(Modelica(version="3.2.1")));
end MyPackage;

There are 0 guests and 0 other users also viewing this topic
You are here: