Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Automatic export from OUT to PDF

Hi, folks,

I am trying to export PDF from OUT file, automatically. Everything works well, ecxept the pssplot.dragdropplotdata command. It seems the command didn't drop any thing in the plot window, which it's supposed to do.

Below here is my piece of code:

#Import from xls
import xlrd 
import os,sys
import pssplot
dir = '''D:\Huy\Test3\\'''
xls_file = dir+'Multiple_CCT.xls'       # xlsx is not acceptable
wb = xlrd.open_workbook(xls_file) 
sh = wb.sheet_by_index(0)
nr = sh.nrows 
pssplot.newplotbook()
for num in range(1,nr):
    #Read from Xls
    OUT= dir+str(int(sh.row_values(num)[0]))+"-"+ str(int(sh.row_values(num)[1]))+"-CCT0.0800s.out"
    NAME=str(int(sh.row_values(num)[0]))+"-"+ str(int(sh.row_values(num)[1]))+"-CCT0.0800s"
    pssplot.openchandatafile(OUT)
    pssplot.dragdropplotdata(NAME,r"""1 - ANGL 35201[G1 220.00]1""")
    pssplot.dragdropplotdata(NAME,r"""2 - ANGL 49502[G2 500.00]1""")
    pssplot.dragdropplotdata(NAME,r"""3 - ANGL 60501[G3 500.00]1""")
    pssplot.exportplot(dir+NAME+"_ANGLE.pdf",4)