Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I do not know of an API command to do this directly outside of an SLD. You could maybe use a loop with the nxtbrn() or nxtbrn3() API commands to accomplish this. If you are okay running the code from the PSSE GUI with an SLD open you could do it using the growbuslevels() API command:

bus_list = list()
psspy.growbuslevels(bus_number, x, y, N_levels)
for component in sliderPy.GetActiveDocument().GetDiagram().GetComponents():
     if 'BU' in component.GetMapString():
          bus_list.append(int(component.GetMapString().split()[-1]))

If you need to use the bus name you would have to work through all the buses in the case using nxtbus() and notona() until you found the bus name you are looking for because most API commands require bus number arguments. PSSE bus names don't have to be unique and multiple buses can exist with the same name so I would caution against this and recommend using bus numbers instead.