Revision history:
Introduced in QPR 7.3.1
Last changed in QPR 2015.1
Returns the ID of an item of the selected type that is active in the user interface.
Synopsis:
PGModel.GetActive(ActiveType, OutID)
Parameters:
ActiveType: String. The type of the active element wanted. Currently supported types are:
•MODEL: Returns the ID of the model that is currently open.
•PROCESSMODEL: Returns the ID of the process model element.
•PROCESSLEVEL: Returns the diagram ID of active diagram or navigator window. If a top level diagram is active, 0 is returned.
•MAINPROCESSLEVEL: Returns the diagram ID of the main (top) diagram.
•ELEMENT: Returns active diagram or navigator window's active element ID. In the case multiple elements are selected, an error is returned.
•USER: Returns the ID of the user who is currently logged in.
•BASEMODEL: Returns the ID of the base model the current model is using. In the case the model does not use a base model, 0 is returned.
•VIEWSETTINGS: Returns the ID of the view settings in the active view (Diagram, Navigator View, or Matrix View).
•ELEMENTINSTANCE: Returns the full ID (<elementId>.<instanceId>) of the active element as string. In case the active element doesn't support instantiating, an error is returned.
OutID: Variant for storing the ID of the returned element. Integer.
Required Rights:
None.
Return Values:
Below are listed the return values that this function can return:
RV_SUCCESS
RV_APPLICATION_QUIT_CALLED
RV_MODEL_NOT_OPEN
RV_NO_ACTIVE_PROCESS_LEVEL
RV_NO_ACTIVE_ELEMENT
RV_NO_ACTIVE_VIEW_SETTINGS
RV_NOT_AUTHENTICATED
RV_INVALID_PARAMETER
RV_INSTANCE_NOT_FOUND
Example Procedure:
iResult = PGModel.GetActive("USER", iId)