Skip to content

GET_ACT_MODEL ​

Is a command call of the message port "Modeling" and returns the modelid of the model that is currently opened and active (visible, on top) in the model editor.

Syntax ​

leo-grammar
  CC "Modeling" GET_ACT_MODEL
  
  # --> RESULT modelid:idValue

Parameters ​

none

Returns ​

  • modelid (idValue) - the modelid of the model that is currently opened and active (visible, on top) in the model editor (integer)

Details ​

The difference to the command GET_ACTIVE_MODEL is that you can use GET_ACT_MODEL with CC, while GET_ACTIVE_MODEL can just be called using SEND.
If no model window is active (i.e. no model window exists), the retured modelid has the value -1.

See Also ​

GET_MODEL_INFO

Examples ​

asc
CC "Modeling" GET_ACT_MODEL
IF (modelid != -1) {
    CC "Core" GET_MODEL_INFO modelid:(modelid)
    CC "AdoScript" INFOBOX ("The curent active model is \"" + modelname + "\"")
} ELSE {
    CC "AdoScript" INFOBOX ("Currently no model window exists.")
}

Queries the ID of the current active model. From the id the model name is retrieved and displayed in an infobox.

Versions and Changes ​

Available since ADOxx 1.3