请问如何用python提取ABAQUS中模态分析的各阶频率为txt文件?

浏览:1121 回答: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

邀请回答 我来回答

全部回答

(2)
默认 最新
长颈鹿爱学习

格式好麻烦,这下应该可以了


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


2017年2月15日
已采纳 评论 6 点赞 1
长颈鹿爱学习
有趣,我来看看
2017年2月15日
评论 点赞

没解决?试试专家一对一服务

换一批