- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Trouble importing packages: Class...
Page Start Prev 1 Next End
Trouble importing packages: Class SI.Temperature not found
Trouble importing packages: Class SI.Temperature not found
Feb-21-17 23:39:04
I think I'm missing something obvious, but I don't seem to be able to use types from packages I've imported:
Code:
model ImportExample
import SI = Modelica.SIunits;
SI.Temperature T;
initial equation
T=2;
equation
der(T) = 1-T;
end ImportExample;
Results in:
Code:
omc -s ../ModelExample.mo
Error processing file: ../ModelExample.mo
[/path/to/ModelExample.mo:4:3-4:19:writable] Error: Class SI.Temperature not found in scope ImportExample.
Error: Error occurred while flattening model ImportExample
# Error encountered! Exiting...
# Please check the error message and the flags.
Execution failed!
Re: Trouble importing packages: Class SI.Temperature not found
Feb-22-17 00:01:37
You need to load the Modelica library also
Code:
omc -s ../ModelExample.mo Modelica
alternative with a script.mos containing;
Code:
loadModel(Modelica); getErrorString();
loadFile("../ModelExample.mo"); getErrorString();
translateModel(ModelExample); getErrorString();
then execute it via;
Code:
omc script.mos
- adrpo
- 885 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Trouble importing packages: Class...
There are 0 guests and 0 other users also viewing this topic