Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

I have written such small program which can build sld file from python, here it is:

def DrawBusesSLD(buslist):
n_buses=len(buslist)
buses=[]
for i in range(n_buses):
  buses.append(buslist[i][0])

for i in range(n_buses):
  psspy.bsys(0,0,[0.0, 750.],0,[],1,[buses[i]],0,[],0,[])
  psspy.growbus(buslist[i][0],buslist[i][1], buslist[i][2])

psspy.bsys(0,0,[0.0, 750.],0,[],n_buses,buses,0,[],0,[])
for i in range(n_buses):
  psspy.growbus(buslist[i][0],buslist[i][1], buslist[i][2])


buslist=[[1000, 0, -3.4],
       [1001, 1.7, -5.1],
       [1002, 3.4, -5.1],
       [1003, 5.1, -3.4]]

DrawBusesSLD(buslist)

Just change buslist variable to the bus numbers and corresponding x,y values.

click to hide/show revision 2
Indentation.

Hi,

I have written such small program which can build sld file from python, here it is:

def DrawBusesSLD(buslist):
 n_buses=len(buslist)
 buses=[]
 for i in range(n_buses):
   buses.append(buslist[i][0])

 for i in range(n_buses):
   psspy.bsys(0,0,[0.0, 750.],0,[],1,[buses[i]],0,[],0,[])
   psspy.growbus(buslist[i][0],buslist[i][1], buslist[i][2])

 psspy.bsys(0,0,[0.0, 750.],0,[],n_buses,buses,0,[],0,[])
 for i in range(n_buses):
   psspy.growbus(buslist[i][0],buslist[i][1], buslist[i][2])


buslist=[[1000, 0, -3.4],
       [1001, 1.7, -5.1],
       [1002, 3.4, -5.1],
       [1003, 5.1, -3.4]]

DrawBusesSLD(buslist)

Just change buslist variable to the bus numbers and corresponding x,y values.