Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abaqus Python - Extract number of steps/frames

Status
Not open for further replies.

creakesiv

Mechanical
Jun 2, 2015
6
0
0
US
I am writing a code in which I need to set a variable to the number of steps and another to the number of frames.
I will then use that to iterate through the steps in viewer and take screenshots. I've looked through the manual and can't find anything that will help me get this, plus I don't really understand the code structure for abaqus yet.
Best,
- Clay
 
Replies continue below

Recommended for you

Try that and modify as needed.

Code:
from abaqus import *
from abaqusConstants import *
from caeModules import *

vps = session.viewports[session.currentViewportName]

odbName = vps.displayedObject.name
odb = session.odbs[odbName]
currentstepnumber = vps.odbDisplay.fieldFrame[0]
currentstepname = odb.steps.keys()[currentstepnumber]
currentframe = vps.odbDisplay.fieldFrame[1]
currentsteptime = odb.steps[currentstepname].frames[currentframe].frameValue

print odbName
print currentstepnumber
print currentstepname
print currentframe
print currentsteptime
 
Status
Not open for further replies.
Back
Top