Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I ended up using a loop. It cycles through all FACTS devices to match a bus # to the name but there are ~ 10 in the case so it is quick. Inelegant escape from the way it exits: either return the bus # or just "not found"

def getname(busnum):
    ierr = psspy.inifax()
    ierr, nextfax = psspy.nxtfax()
    nextbus = ""
    while ierr ==0:
        ierr, nextbus = psspy.fcdint_2(nextfax, 'SEND')         
        if nextbus == busnum:
            #print "found it " + str(nextfax)
            return str(nextfax)
        else:
            ierr, nextfax = psspy.nxtfax()
    return "notfound"