Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Nov 21, 2018
Messages
13
Location
CH
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?
 
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

Back
Top