fdsssr
Civil/Environmental
- Feb 19, 2007
- 4
Hello members,
I am new here, and a beginner in scripting. So my problem is that I want to write field output reports, in large numbers, each frame in a different .rpt. I thought i could easily use a script and a loop, but I absolutely don't understand how python works. Anyway I found the function that probably does what I want, it's "writeFieldReport". But when I try to run a script with that function and its arguments, I still have that message "IOError: Empty filename".
I put hereunder what i wrote:
myViewport = session.Viewport(name='Essai')
odbPath = 'hydro-mulet-2.odb'
myOdb = visualization.openOdb(path=odbPath)
myViewport.setValues(displayedObject=myOdb)
myOutputFile = open('hydro-mulet-2-s1f01.rpt','w')
session.writeFieldReport(filename='myOutputFile',
append=OFF,sortItem='Element Label',odb=myOdb,step=1,frame=1,
outputPosition=WHOLE_ELEMENT,variable=['EVOL',WHOLE_ELEMENT,(COMPONENT,'EVOL')])
myOutputFile.close
Please help me correct the wrong arguments: I especially don't understand how to handle the filename and displayGroup (it seems to be requested but I don't know what to write! I simply want "All").
Thanks!
I am new here, and a beginner in scripting. So my problem is that I want to write field output reports, in large numbers, each frame in a different .rpt. I thought i could easily use a script and a loop, but I absolutely don't understand how python works. Anyway I found the function that probably does what I want, it's "writeFieldReport". But when I try to run a script with that function and its arguments, I still have that message "IOError: Empty filename".
I put hereunder what i wrote:
myViewport = session.Viewport(name='Essai')
odbPath = 'hydro-mulet-2.odb'
myOdb = visualization.openOdb(path=odbPath)
myViewport.setValues(displayedObject=myOdb)
myOutputFile = open('hydro-mulet-2-s1f01.rpt','w')
session.writeFieldReport(filename='myOutputFile',
append=OFF,sortItem='Element Label',odb=myOdb,step=1,frame=1,
outputPosition=WHOLE_ELEMENT,variable=['EVOL',WHOLE_ELEMENT,(COMPONENT,'EVOL')])
myOutputFile.close
Please help me correct the wrong arguments: I especially don't understand how to handle the filename and displayGroup (it seems to be requested but I don't know what to write! I simply want "All").
Thanks!