【ABAQUS脚本】后处理快速出图

效果图:

img

# -*- coding: utf-8 -*-
# Do not delete the following import lines
from abaqus import *
from abaqusConstants import *
import __main__
from odbAccess import *

# odb name
odbName='Job-case1.odb'
myodb=session.odbs[odbName]

stepName='Step-1'
# frame index list
frameList=[1,10,8,9,5]
# Var 

viewportKeyList=session.viewports.keys()

# 现有的viewport 全部最小化
for i in viewportKeyList:
    session.viewports[i].minimize()

viewportKeyList=[]
for frame in frameList:
    n='Script Frame : '+str(frame)
    session.Viewport(name=n)
    viewportKeyList.append(n)
    

for i in range(len(viewportKeyList)):
    # viewport name
    viewKey=viewportKeyList[i]
    # frame
    f=myodb.steps[stepName].frames[frameList[i]]
    # 设置为odb
    session.viewports[viewKey].makeCurrent()
    session.viewports[viewKey].setValues(displayedObject=myodb)
    # set frame showing 
    session.viewports[viewKey].odbDisplay.setFrame(frame=f)
    # 变形云图显示
    session.viewports[viewKey].odbDisplay.display.setValues(plotState=(CONTOURS_ON_DEF, ))
    # edge 可视化
    session.viewports[viewKey].odbDisplay.commonOptions.setValues(visibleEdges=FEATURE)
    # 白色背景
    session.graphicsOptions.setValues(backgroundStyle=SOLID,backgroundColor='#FFFFFF')
    
    session.viewports[viewKey].viewportAnnotationOptions.setValues(
        compass=OFF)
    session.viewports[viewKey].viewportAnnotationOptions.setValues(title=OFF)
    session.viewports[viewKey].viewportAnnotationOptions.setValues(
        annotations=OFF)
    session.viewports[viewKey].viewportAnnotationOptions.setValues(
        legendBox=OFF)
    session.viewports[viewKey].view.setValues(session.views['Iso'])
    session.viewports[viewKey].view.fitView()
    session.viewports[viewKey].odbDisplay.contourOptions.setValues(
        contourStyle=CONTINUOUS)
posted @ 2024-01-25 12:49  FE-有限元鹰  阅读(243)  评论(0编辑  收藏  举报