Macro to Retrieve Displacement Data from ODB File
Macro to Retrieve Displacement Data from ODB File
(OP)
Hi,
I have been trying to record the macro for retrieving displacementdata from ABAQUS ODB File.I have picked a single node and tried to retrieve the displacement data for that particular node.
odb = session.odbs['H:/MiniThessis/MaterialModelling/First_Test.odb']
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U',
NODAL, ((INVARIANT, 'Magnitude'), )), ), nodePick=(('PART-1-1', 1, (
'[#0:237 #8 ]', )), ), )
xy1 = session.xyDataObjects['U:Magnitude PI: PART-1-1 N: 7588']
In the recorded Macro above, I could not understand what exactly is "#0:237 #8" ??
I would be really glad,if someone can explain that
Thanks in advance!
I have been trying to record the macro for retrieving displacementdata from ABAQUS ODB File.I have picked a single node and tried to retrieve the displacement data for that particular node.
odb = session.odbs['H:/MiniThessis/MaterialModelling/First_Test.odb']
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U',
NODAL, ((INVARIANT, 'Magnitude'), )), ), nodePick=(('PART-1-1', 1, (
'[#0:237 #8 ]', )), ), )
xy1 = session.xyDataObjects['U:Magnitude PI: PART-1-1 N: 7588']
In the recorded Macro above, I could not understand what exactly is "#0:237 #8" ??
I would be really glad,if someone can explain that
Thanks in advance!





RE: Macro to Retrieve Displacement Data from ODB File
#0:237 represents the node list on Part-1-1 where node #8 is picked from.
Hope this helps.
RE: Macro to Retrieve Displacement Data from ODB File
May be it is better to create set for node and history output for displacement of this node.
RE: Macro to Retrieve Displacement Data from ODB File
Could you please explain,how can I retrieve net displacement of a node,if I know a node number
can you please write the macro for doing that?
Would be really helpful!
RE: Macro to Retrieve Displacement Data from ODB File
You have to read Abaqus-Scripting-Accessing an Output Database chapter of Help
RE: Macro to Retrieve Displacement Data from ODB File
RE: Macro to Retrieve Displacement Data from ODB File
If I am writing these 3 lines to retrieve xy data object for displacement.
odb = session.odbs['H:/MiniThessis/MaterialModelling/First_Test.odb']
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U',
NODAL, ((INVARIANT, 'Magnitude'), )), ), nodePick=(('PART-1-1', 1, (
'[#0:237 #8 ]', )), ), )
xy1 = session.xyDataObjects['U:Magnitude PI: PART-1-1 N: 7588']
I want to define the node variable as 'N' , instead of the number '7588' and what do i write for "#0:237 #8 "?? How can I retrieve "#0:237 #8", from a given node label??
Thanks in Advance.
RE: Macro to Retrieve Displacement Data from ODB File
1. Access the result by using the node label instead the pick command.
2. Store the result of the command directly in a variable.
Example with my odb and node label 14:
CODE -->
odb = session.odbs['Job-1.odb'] xy1 = session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U', NODAL, ((INVARIANT, 'Magnitude'), )), ), nodeLabels=(('PART-1-1', ('14', )), )) # use print to test what you get print xy1RE: Macro to Retrieve Displacement Data from ODB File
I have tried the above Macro,which you have suggested with my ODB.
When I tried to print it:
its printing this: [xyDataObjects['U:Magnitude PI: PART-1-1 N: 1837']].
How do I retireve the displacement value from this xyObject. Please explain.I guess,we need to add one more macro line for that?
Waiting for your reply
RE: Macro to Retrieve Displacement Data from ODB File
Thanks for your reply.
I could now retrieve the displacement value.
I have written the follwing macro lines and its working:
xy = session.xyDataListFromField(odb=o1, outputPosition=NODAL, variable=(('U',
NODAL, ((INVARIANT, 'Magnitude'), )), ), nodeLabels=(('PART-1-1', (str(Node),
)), ))
xy1 = session.xyDataObjects['U:Magnitude PI: PART-1-1 N: '+str(Node)]
print xy1[0][1]
RE: Macro to Retrieve Displacement Data from ODB File
So in your example
print xy[0]
print xy1
would print out two identical lines.
RE: Macro to Retrieve Displacement Data from ODB File
When I say,print xy[0], it prints out "[(1.0, 0.00329504604451358)]". How do I print out only the second value.
I tried out with xy[0][0} as well as xy[0][1],but I am not getting the value as "0.00329504604451358".
RE: Macro to Retrieve Displacement Data from ODB File
then
xy[0][0] is (1.0, 0.00329504604451358)
and
xy[0][0][1] is 0.00329504604451358
RE: Macro to Retrieve Displacement Data from ODB File
Thanks a lot for your reply.
I have written a similar script for retrieving VonMisses stress data
xy1 = session.xyDataListFromField(odb=o1, outputPosition=ELEMENT_NODAL, variable=((
Variable, INTEGRATION_POINT, ((INVARIANT, ParameterName), )), ), elementSets=(
SetName, ))
x0 = session.xyDataObjects[Variable+':'+ParameterName+ ' PI: PART-1-1 E: '+str(Element)+' N: '+str(Node)]
nodalVal = x0[0][1]
print(x0[0][1])
print(xy1[0][0][1])
But,after running the above script,I am getting different values when I print these two values.
Which one do u think is correct??
RE: Macro to Retrieve Displacement Data from ODB File
I would be really glad,if you can reply to the above query.
Thanks in Advance
RE: Macro to Retrieve Displacement Data from ODB File
RE: Macro to Retrieve Displacement Data from ODB File
Thanks a lot.So,Its better to use UNIQUE NODAL to get the required one in my case.