Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Abaqus Scripting Error Handling

Status
Not open for further replies.

catrueeb

Mechanical
Nov 21, 2018
13
I am trying to setup a python routine which opens a mdb, does some tasks, and writes the .inp file, for a lot of different parameters. I am runnning the file with abaqus cae noGUI=.... Naturally, sometimes errors occur, e.g. when creating the mesh. How can I catch the exceptions? I could not find any feedback values of generateMesh and other functions in the Scripting Manual. When an error occurs, the script still runs and somehow NO EXCEPTION occurs at all (so I cannot catch it...). How can I check for errors?
 
Replies continue below

Recommended for you

Hi catrueeb,

I had a similar issue when trying to select curved faces from an ABAQUS model.
The code stops when a planar face is encountered with an error message.
This can be overcome and an error message displayed with the 'try' command.
I have attached a snippet .

Python:
for k in range(len(facelist)):
	curface=facelist[k]
	try:
		temp=curface.getCurvature(curface.getCentroid()[0])
		if curface.getSize()-R1 < tol1:
			inner_face.append(curface)
		elif curface.getSize()-R2 < tol2:
			outer_face.append(curface)
	except AbaqusException:
	        print "Planar face encountered" 	# exception message

I have tried this in the GUI mode and it works.
Hope this helps.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor