Skip to main content

saving abaqus odb with new name in python

Submitted by Nunzio Losacco on

Hi all,

I would like to add some custom fieldOutputs to an odb and I wish to save the results using a different name for the odb, in order not to mess up the original odb. For how much I tried I cannot find a solution, it seems that I can only save an odb with using its original name/path . Does anybody know how to do that?

Thanks

You might not need to save the entire ODB separately, rather could do away with saving only the information you need to save. The following example does it for some custom XY data.

odb = session.Odb(name='NEW_ODB_NAME.odb', onlyHasUserDefinedData=ON)
xy = session.xyDataObjects['XYData-1']
odb.userData.XYData('XYData-1', xy)
odb.save()

Regards

Tue, 03/29/2016 - 17:47 Permalink

I do not understand. You said two seemingly contradictory things.

1. "wish to save the results using a different name for the odb, in order not to mess up the original odb"

2. "annoys me is having to write the (possibly huge) odb twice"

If you don't wish to mess up the original odb, then writing/copying a new one is the logical resort.

 

Am I missing something?

 

 

Mon, 04/04/2016 - 17:56 Permalink

Sorry if I wasn't clear

Your proposal is what I did:

open original odb --> copy to new odb --> add fields --> save new odb      two write operations

I wonder if there is an easy way to do:

open original odb --> add fields --> save to new odb     sparing the first copy

In simpler terms, if you want to modify, say,  a text file and save it with a different name, usually you do not need to copy the original file with a new name first! Can you do it with an odb?

Wed, 04/06/2016 - 08:58 Permalink