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 cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP ! URGENT ! Export deformed shape into any CAD format from ABAQUS 1

Status
Not open for further replies.

kooshaa

Mechanical
Joined
Mar 25, 2016
Messages
15
Location
DE
thread799-178458

Hi everybody,

I have done an analysis in abaqus and then I had to export the final part geometry in a CAD file. But unfortunately the abaqus add-on for direct export of the final part geometry is not working so I have to write a python script for it. There was a thread many years ago and one of the members here (cdeepakroy) wrote a script but it was 2D and he saved it in VTK. Does anybody know how whould be script if it were to be 3D and saved as VRML or STL?

Here is the script:

# create odb object from odb file
outputDatabase = session.openOdb(name= ImplantAnalysisJob.name + '.odb' )

# get access to the nodal displacement data
frame = outputDatabase.steps[ '<give-step-name-here>' ].frames[-1]

dispField = frame.fieldOutputs['U']

# get access to the part instance -- thru which u can access the undeformed nodal position coordinates
my_part_instance = outputDatabase.rootAssembly.instances['PART-1-1']


# Write deformed shape to vtk file
# NOTE: if you want to export to a different file format, you should appropriate code for that file format here

outFile = open( 'deformed_shape.vtk' , 'w' )

# write vtk header

outFile.write( '# vtk DataFile Version 3.0' )
outFile.write( '\nvtk output' )
outFile.write( '\nASCII' )
outFile.write( '\nDATASET UNSTRUCTURED_GRID' )

# write points

numNodesTotal = len( my_part_instance.nodes )

outFile.write( '\n\nPOINTS ' + str( numNodesTotal ) + ' float' )

for i in range( numNodesTotal ):

curNode = my_part_instance.nodes

defNodePos = curNode.coordinates + dispField.values.data

outFile.write( '\n' )

for j in range( 3 ):

outFile.write( str( defNodePos[j] ) + ' ' )

# write cells

numElementsTotal = len( my_part_instance.elements )

outFile.write( '\n\nCELLS ' + str( numElementsTotal ) + ' ' + str( numElementsTotal * 5 ) )

for i in range( numElementsTotal ):

curElement = list( [4] + list( my_part_instance.elements.connectivity ) )

outFile.write( '\n' )

for j in range( 5 ):

outFile.write( str( curElement[j] ) + ' ' )

# write cell types

outFile.write( '\n\nCELL_TYPES ' + str( numElementsTotal ) )

for i in range( numElementsTotal ):

outFile.write( '\n10' )

# write cell data

outFile.write( '\n\nCELL_DATA ' + str( numElementsTotal ) )

# write point data

outFile.write( '\n\nPOINT_DATA ' + str( numNodesTotal ) )

outFile.close()

outputDatabase.close()
 
Dear rstupplebeen,

Tnx for the answer but as I said Unfortunately that option doesn't work. It only export the tool geometry and not the part geometry.
 
Get the deformed mesh of the part into a new model by importing from the .odb

Then try to export as .STL using the plug-in. Might work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top