-1
odbname = data.jobname + '.odb'
        mySession  = session.openOdb(name = odbname)
        myViewport = session.viewports["Viewport: 1"]
        #plot stress
        myViewport.setValues(displayedObject=mySession)
        myViewport.odbDisplay.display.setValues(plotState=(CONTOURS_ON_DEF,))
        myViewport.view.fitView()
        session.viewports['Viewport: 1'].viewportAnnotationOptions.setValues(
        legendFont='-*-verdana-medium-r-normal-*-*-120-*-*-p-*-*-*')

当我运行这个程序时,我能够看到视图 iso 我需要获得前视图方向的视图,所以任何人都可以告诉我如何使用 python 编码更改视图

这是我的导入模块

from abaqus import *                # from the main library
from caeModules import *            # import the modules
from abaqusConstants import *       # constants we need
from math import fabs
from abaqus import backwardCompatibility
backwardCompatibility.setValues(reportDeprecated=False)
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step
import interaction
import load
import mesh
import optimization
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
4

1 回答 1

1

For abaqus the easiest thing to do watch the replay output generated by abaqus cae. Open the model manually in CAE and change the view to what you would like to see. Abaqus writes a python replay file of all the actions the user takes in the CAE window. Navigate to your working folder and find the file named abaqus.rpy. The last lines in that will be the python commands to replicate your actions in CAE.

于 2014-11-21T17:39:28.120 回答