Skip to content

GET_MODEL_INFO ​

Is a command call of the message port "Core" and returns name, type, library and access information about a model.

Syntax ​

leo-grammar
CC "Core"	GET_MODEL_INFO	modelid: idValue

#--> RESULT modelname:strValue ver:strValue version:strValue version:strValue
			threadid:idValue modeltype:strValue libid:idValuelibtype:strValue
			libname:strValue access:strValue ecode:intValue

Parameters ​

  • modelid (idValue) - specifies the ID of the model

Returns ​

  • modelname (strValue) -
  • ver (strValue) -
  • version (strValue) -
  • threadid (idValue) -
  • modeltype (strValue) -
  • libid (idValue) -
  • libtype(strValue) - contains either "bp" or "we"
  • libname (strValue) -
  • access (strValue) - contains either "none", "write" or "read"
  • ecode (intValue) -

Details ​

The model has to be specified by passing the model ID with modelid.

The name of the model is returned with modelname, the model type with modeltype and the ID of the related library is returned with libid.

If the library is versioned (time-related), the modelversion is returned in long format with version and in short format with ver.
For time-related versioned libraries the thread ID (see "Introduction on Versioning") is returned with threadid.

The return value access holds the value "none" if the model is not loaded. If it is loaded, then "read" or "write" is returned, depending on whether the current user may read or write to that model. (Actually in that case the same info is returned as with command GET_ACCESS_MODE.)

See Also ​

GET_ACT_MODEL

Examples ​

asc
CC "Modeling" GET_ACT_MODEL
IF (ecode = 0) {
    CC "Core" GET_MODEL_INFO modelid:(VAL modelid)
    CC "AdoScript" INFOBOX (
        "The active model is \"" + modelname + "\" (" + modeltype + ")"
    )
} ELSE {
    CC "AdoScript" ERRORBOX "No model is opened!"
}

Before you execute this example, open an existing model. The script retrieves the id of the currently opend model and calls GET_MODEL_INFO to get the modelname and type and prints an infobox.

Versions and Changes ​

Available since ADOxx 1.3