Function GetEquipment

 

Function GetEquipment( ByVal nType&, ByRef Handle ) As Long

Purpose: Retrieves handle of the next equipment of given type in the system. If nType is set to TC_PICKED, this function will return the handle of the selected equipment on the one-line diagram. If nType is set to the equipment code for generators, shunts, loads, generating units, shunt units, load units, lines, series capacitors, transformers, phase shifters, switchs, relay groups, overcurrent relays, fuses, distance relays, differential relays, voltage relays, reclosers and logic schemes, this function will return the handle of all the objects, one by one, in the order they are stored in the OneLiner or Power Flow OLR file.

Works in:      OneLiner and Power Flow.

Parameters:     

nType       [in] equipment type (table 3.2)

nHandle     [in/out]equipment handle.

Return value:

1               success

-1              already at the end of the list

0               failure

Remarks: Set nHandle to zero to get the first equipment handle. Set nType to TC_PICKED  if you want to see which network element was highlighted on the one-line diagram by the user. (If the user has highlight more than one piece of equipment, only the handle of the first selection is returned.)

Example:

 

If GetEquipment( TC_PICKED, nBusHnd ) = 0 Then

  Print "Must select a bus"

  Stop

End If