Thank you Adrian. The buildModel function works just fine.
-----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von Adrian Pop Gesendet: Dienstag, 16. Dezember 2008 14:05 An: [email protected] Betreff: Re: Model init file without simulation? Hi, You can use a function called buildModel(same arguments as simulate) This will build your model, generate an executable and everything needed but will not call the executable. You could then just call it from the script with system("Model.exe") if you want. We also plan to support loading of libraries using flags when calling omc. Something like: omc +load=Lib1,Lib2,Lib3 +s Model. Cheers, Adrian Pop/ [email protected] wrote: > Hi, > > I have issues with creating the OpenModelica C code for a model in an > automatical manner. > > I can use omc on the command line, like `omc +s model.mo`. But the > model has to be *total*, i.e. no Modelica types can be used unless by > copying the relevant code directly into the model. Are there plans to > change that in the near future? > > Instead, I can write a mos script file. There I first load the > Modelica library, all dependent models and finally the model to > compile. Then I can produce the code by calling either > `translateModel` or `simulate` in the script. But I don't really want > to simulate it at that time. Rather just create the code. So that > leaves only `translateModel`, which doesn't produce the > model_init.txt file. Is that intended? I take it the code depends on > the init file. Are there other means for creating the init file? Or > even for creating the code? > > Regards, Alexander > -- _____________________________________________________________________ Adrian Pop | PhD Open Source Modelica Consortium | Technical Coordinator Department of Computer Science | http://www.ida.liu.se/~adrpo Linköping University | phone:+46 76 2343499/+46 13 285781 S-581 83 Linköping, Sweden | fax: +46 13 142231 OSMC & LiU/IDA/PELAB | office: 3B:478
