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

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.

Re: How to create an exemple class protected from modification

Thanks for the help and quick answer. I will try.

I will also seek information for the "paid version ?"  Seems to be new ..?

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.

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 ....  current/sad

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.

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....

Edited by: Klaus74 - Sep-11-20 12:30:23
There are 0 guests and 0 other users also viewing this topic
You are here: