We are using the lockFolder function to lock a library we are developing. When using a locked library where we have a frame called Frame, trying to derive it from the library it is created in a folder called Public, and then we rename the derived frame to DeriveFrame. But DeriveFrame can't be moved anywhere. Why is there such a restriction on derived objects?
Solved! Go to Solution.
When you are developing a library, you should unlock the library. Lock the library before you give it to the end-user, so the end-user cannot make changes. Deriving a class would be such a change. If the end-user would create an additional object inside the library, and if the end-user would then at a later point in time update the library with a newer version, such an additional object would be deleted!
Sometimes it makes sense to derive a class from a library class. If the library is locked, such a derived class will be put into the "Public" folder where it will not be deleted when the library is being updated.
It is be possible to move classes out of the "Public" folder (as long as the class is not moved into a locked library).
As I already tried to say: Classes can already be moved out of the Public folder (I checked this with version 12.0.4). Hold down the Shift key and drag&drop the class into a folder that is not part of a locked library.
Please note that it does not make a difference if the class is in the public folder or in a folder outside the library. In both cases the class will not be considered to be part of the library, so the class will not be deleted during an update. The class still inherits from the library class, so during an update all changes made in the library class will be propagated to the derived class. The changes you made in the derived class will be kept.
Sorry, I checked again to move from the Public folder and it worked. I forgot to mention in my first post that we are using a user-defined license on the library. If I try to move something from the Public folder of the locked library, I get this error:
So they are not able to be moved if the library requires a license?
If you build a library that requires a user-defined license, you do not want that the users can simply move all classes out of the library folder into a folder without the user-defined license. This way the user could create an unlicensed version of the library.
Say that you want to lock the library to prevent changes, but also restrict the usage of the library to specific people. If we use the user-defined license and lock it, then we have to build all models under the Public folder.
Wouldn't it be possible to have a similar check as when saving libraries and Plant Simulation detects that objects included in the library are inherited from outside the library but also check that the objects being saved are not inherited from a class that is saved with a user-defined license?
This would enable instances of the objects in the library to be located in a more sensible hierarchy in the .Models folder and prevent users to edit the original objects.
I would strongly advise against building simulation models inside the library folder. When you update the library – no matter wether the library is locked or not – all additional stuff will be deleted (unless it is in the public folder).
Yes, but if we are using a locked library with a user-defined license, it's not possible to move the models so all the models will be placed under the Public folder inside the library. This is why it would be good to have the instances of the classes from a library also inherit the license requirements. This would make sure that we can move the instances freely in the class library, but other people would not be able to save the instances into a new library without removing the license first.
When an object is being saved into a model file or an object file, all origin objects will be saved too. So, if you save an instance that inherits from a licensed class, the class and the surrounding folder will saved too, and therefore the model/object file will still require the license.
So, there is really no need to create the model inside the library folder.