Please enable JavaScript to view this site.

QPR Knowledge Base 2019.1

Navigation: Developer's Guide > QPR API > The Object Model > QPR Modeling > PGModel Commands

OptimizeRoute

Scroll Prev Top Next More

Revision history:

Introduced in QPR 8.0

Last changed in QPR 2012.2

 

Optimizes flow routing, distribution, and alignment for optimal diagram appearance. This function can be used on flows, elements with incoming or outgoing flows, and diagrams.

 

Synopsis:

 

PGModel.OptimizeRoute(FullId, Parameters)

 

Parameters:

 

FullId: String. Consists of two dot-separated integers: ModelObjectId.InstanceId. Supported elements are flows, elements which take incoming flows or have outgoing flows, and diagrams.

Parameters: String. A semicolon-separated set of parameters. Supported parameters:

STARTPOINT: Optional.  If this parameter is included, the flow's From element connection point is adjusted to be closest to the optimum in the case the From element position is known. This parameter is applicable only when FullId refers to a flow.

ENDPOINT: Optional.  If this parameter is included, the flow's To element connection point is adjusted to be closest to the optimum in the case the To element position is known. This parameter is applicable only when FullId refers to a flow.

DISTRIBUTE: Optional. If this parameter is included, flows having the same From/To target are distributed within even distances alongside the From/To element side.

ALIGN: Optional.  If this parameter is included, flows having the same From/To target are aligned within the From/To element side

 

Required Rights:

 

Administrator or model administrator rights to PGModel.

 

Return Values:

Below are listed the return values that this function can return:

 

RV_SUCCESS

RV_UNKNOWN_ERROR

RV_APPLICATION_QUIT_CALLED

RV_MODEL_NOT_OPEN

RV_INVALID_PARAMETER

RV_NOT_ENOUGH_RIGHTS

RV_FUNCTION_CANNOT_BE_USED_IN_VALIDATION_SCRIPT

 

Example Procedure:

 

iResult = PGModel.OptimizeRoute("1234567.5678990", "STARTPOINT;ENDPOINT")

'Start and end points are both optimized

 

iResult = PGModel.GetActive("PROCESSLEVEL", iId)

iResult = PGModel.OptimizeRoute(iId, "DISTRIBUTE")

'FullId refers to a diagram and causes all flows on that diagram to be distributed within the element sides