Scripting problem,node coordinate
Scripting problem,node coordinate
(OP)
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
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





RE: Scripting problem,node coordinate
Therefore,
1. You have to request COORD to be output.
or:
2. Compute them from initial coordinates + current displacements.
RE: Scripting problem,node coordinate
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?
RE: Scripting problem,node coordinate
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)
RE: Scripting problem,node coordinate
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[i]
Thank you
Dariush
RE: Scripting problem,node coordinate
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.