- Index
- » Programming
- » Modelica Language
- » CombiTable file path
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,
- dersh
- 66 Posts
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;
- sjoelund.se
- 1700 Posts
- Index
- » Programming
- » Modelica Language
- » CombiTable file path