请问如何用python提取ABAQUS中模态分析的各阶频率为txt文件?
浏览:1304 回答:10
自己写了一个,可是总是有语法问题,求大神指教
from odbAccess import *
odb = openOdb(path='Job-1.odb')
step = odb.steps['Step-1']
f = open('poemout.txt', 'w') # open for 'w'riting
for frame in step.frames:
for aa in frame.frequency:
aa=frame.frequency
f.write('%10.5s\n' %aa) # write text to fil
f.close() # close the file
格式好麻烦,这下应该可以了
from odbAccess import *
vp = session.viewports[session.currentViewportName]
odb = vp.displayedObject
f = open('poemout.txt', 'w')
for step in odb.steps.values():
if step.domain == Step-1:
frames = tuple(step.frames)[0:]
for t in frames:
f.write('%10.5s\n' %t.frequency)
f.close() # close the file