« Back to University of Vienna - OMILAB

Pictures of referenced model

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Pictures of referenced model
university of vienna - omilab
Answer
1/18/18 7:27 AM
Dear ADOxx Team
 
In my modelling method, there is a modeltype, which consists of objects with interrefs to other models. The goal is, that pictures of the referenced models are shown as icons of the objects, which contain the interref. In the way as the “Referenced subprocess” attribute of the “__Subgraph__” class works. But I don’t want reference processes, so I want to know if there is a way to change the name of the attribute, in a derived class of “__Subgraph__”? Further I wanted to know if it is possible to trigger the showing and hiding of the referenced subprocesses with AdoScript? And if the showing of referenced subprocess can be configured, so that the user of the modelling toolkit or a AdoScript can resize and reposition the objects?
 
Thank you in advance.
 
Kind regards
Christian

RE: Pictures of referenced model
Answer
2/6/18 3:57 PM as a reply to Christian Muck.
To have submodel functionality realized, you do not need to derive it from the abstract "__Subgraph__" class.
You want to use the "Model pointer" class attribute (a platform attribute, that is available for every class, similiar as GRAPHREP). A step-by-step guide how to define the modelpointer is below:

a) Create a new INTERREF attribute in the class you want to provide sub-model functionality. The INTERREF needs to be defined to as a single model reference.
e.g.
1REFDOMAIN
2  MODREF    
3    mt:"Storyboard"    
4    max:1


b) Define the "Model pointer" by entering the name of the INTERREF attribute defined in a) as the standard value.
c) READY!

The functionality that is available through the model pointer is:
a) Submodel viewing (expand/shrink): new entries are available in the context menu of such objects (see screenshot)
b) CTRL-Double Click to jump to the model


Interaction with AdoScript is possible. The following commands are available in the Modeling messageport

# check whether an object is expanded
CC "Modeling"IS_EXPANDED objid:id .
#-->RESULT ecode:intValue expanded:boolValue .

# expand the submodel reference by the object
CC "Modeling"EXPAND objid:id .
#-->RESULT ecode:intValue .

# shrink the submodel referenced by the object
CC "Modeling"SHRINK  objid:id .
#-->RESULT ecode:intValue .

In case you want to change things in the submodel, you need to interact with the submodel itself.
Attachment

Attachments: SUBMODEL.png (240.9k)