- Index
- » Programming
- » Modelica Language
- » How to create an exemple class...
How to create an exemple class protected from modification
How to create an exemple class protected from modification
I would like to create an example class that can be run, but not modified, like the examples of the Modelica libraries.
But after looking at the code of the Modelica examples, I can't see what to do for that purpose.
Thanks for any help.
Re: How to create an exemple class protected from modification
There are two ways to load a package:
* It is stored in the MODELICAPATH and you use it as a system library. Then we load it read-only and it cannot be modified.
* You load a .mo-file by opening it. OMEdit then assumes you want to be able to edit it.
If you have access to the paid version, encrypted models cannot be modified either.
- sjoelund.se
- 1700 Posts
Re: How to create an exemple class protected from modification
You can also use .mol (is a zip file), export the library as that. "Export" -> Read-only Package - Exports a zipped Modelica library with file extension .mol
https://openmodelica.org/doc/OpenModeli … #file-menu
If you load .mol in OMEdit they will be read only.
- adrpo
- 885 Posts
Re: How to create an exemple class protected from modification
Thanks adrpro, but it seems something is wrong, missing, or not allowed, because I can't export to read only package. The line "export to read only package" in the file menu is "light grey", not active ....
Re: How to create an exemple class protected from modification
Perhaps you are trying to do it on a model. Its only allowed on top level package.
Adeel.
- adeas
- 454 Posts
Re: How to create an exemple class protected from modification
Yes, I have created a custom library, and I would like to propose examples to the users. But up to now, my examples can be modified. And I would like that they remain unmodifiable.
Sorry to bother again, but I tried all, and there I have found no way apparently to create a non modifiable example. It seems that just some few words of help on a forum is not enough for me to do that....
- Index
- » Programming
- » Modelica Language
- » How to create an exemple class...