« Back to Frequently Asked Questions

Create a model where modelling is not possible

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Create a model where modelling is not possible
mode modeltype
Answer
5/29/19 8:16 AM
My purpose is to create a model of a modeltype, where modelling is not possible. I saw that it is possible to add a mode to a model type with a property „no-modeling“. Doing this it says that the defined mode will not be applicable for modeling and will not be shown in the menu entry "Mode" of the modeling component (https://www.adoxx.org/live/model-types). Now my Question: How can I switch the mode for a model to a „no-modelling“ mode respectively can I specify during the creation of a model that it should be created in the „no-modelling“ mode?

RE: Create a model where modelling is not possible
mode modeltype adoscript
Answer
5/29/19 9:05 AM as a reply to Anonymous.
If you add a mode with the attribute “no-modeling” to a model type, then this mode will not be shown in View→Mode menu in the ADOxx Modelling Toolkit. Therefore it is not possible to manually switch a model of the specified model type to the “no-modeling” mode. To my knowledge it is also not possible to switch a model to a “no-modeling” modi using AdoScript. However, as your purpose is to “Create a model where modelling is not possible” then you can f.e. do the following: Write an AdoScript code to create your model and then to open it “write-protected”. Here you have a short example code:

 1CC "CoreUI" MODEL_SELECT_BOX mgroup-sel without-models
 2#--> RESULT ecode:intValue mgroupids:idList
 3
 4CC "Core" CREATE_MODEL  modeltype: ("Sample")
 5                        modelname: ("TestModel22")
 6                        version: ("0.1")
 7                        mgroups: (mgroupids)
 8
 9#--> RESULT ecode:intValue modelid:id threadid:id refids:strValue
10
11CC "Core" DISCARD_MODEL modelid: (modelid)
12CC "Modeling" OPEN modelids: (STR modelid) write-protected

In the above code a new model of a specified model type is created within a selected model group. Next, the created model is opened “write-protected”, which disables changes in the model.