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

Scripting problem,node coordinate 3

Status
Not open for further replies.

dariushtari99

Mechanical
Joined
Jun 15, 2007
Messages
25
Location
CA
Hi
Here is the Problem.I want read node coordinates of a defomed part (by scripting) from an Odb and later submit the edited meshing as a new model for analysis.But i dont know where the deformed node coordinate data is saved and how to access them.I could n't access them like the outputfield.pls help.
thank you so much

Ps. i have submited another subject to which nobody replied.I would appreciate it if you could read it too.
the title was:
HELP!How to find the intersection of a line with an arbitrary surfac
 
The current nodal coordinates are not output by default.

Therefore,
1. You have to request COORD to be output.

or:

2. Compute them from initial coordinates + current displacements.
 

Thank you so much Xerf it realy helped i realy admire your

knowledge and help!But still i have problem with seprateing

x,y,z variables :

firstStep = myOdb.steps['forming']
frame1 = firstStep.frames[1]
coordinate1=frame1.fieldOutputs['COORD']
x=coordinate1.values[0] ????

i dont know how to assign COOR1 to x?
 
See the next example:


myOdb=session.odbs["odb_name]
myStep=myOdb.steps["step_name"]
last_frame_in_step=myStep.frame[-1]
coords=last_frame_in_step.fieldOutputs['COORD']
no_of_Nodes=len(coords.values)
for iValue in coords.values:
node_label=iValue.nodeLabel
instance_name=iValue.instance.name
x_node=iValue.data[0]
y_node=iValue.data[1]
z_node=iValue.data[2] #for 3D models
print "Part instance =%s, Node label = %i , x=%.15f, y=%.15f, z=%.15f"%(instance_name, node_label, x_node, y_node, z_node)
 
Dear Xerf i thought you would have the answer as you had last time so i asked the question here either.
I m trying to read the COORD data from an specifies instance nodes.But i get an following error:

this is what i wrote:

myOdb = visualization.openOdb(path='initial.odb',readOnly=FALSE)
firstStep = myOdb.steps['forming']
coords0=frame0.fieldOutputs['COORD']
coordxValue=coords0.values
coordxinstance=coordxValue.instance(name='TUBE-1',object=)

the error is :
AttributeError:'FieldValueArray' object has no Attribute 'instance'

And also i m not sure if i can get each Coordinate(x,y,z) using : iValue.data

Thank you
Dariush
 
If you pay attention to the example I wrote above you can see the differences.

Concerning your code:
coords0.values represents and array, namely a 'FieldValueArray' . If you want to see the name of the instance corresponding to a specific value in this array use: coords0.values[index].instance.name , where index is an integer.

To obtain a the a fieldOutput containing only the values of within a specific part instance use
subField=fieldOutput.getSubset(region=myOdbInstance) method,
where for region you should supply and OdbInstance object.

You can obtain the OdbInstance object from:
myOdbInstance=session.odbs["myOdbName"].rootAssembly.instances["myInstanceName"]

I recommend to read "ABAQUS Scripting User's Manual" which contains a very good introduction to how to use the scripting features.

Best.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top