MegaStructures
Structural
- Sep 26, 2019
- 366
Hello,
For my research I have to create the same XY plot with different data a painful number of times. I am trying to use an Abaqus macro to make my life easier, which seems to work great until I try to use it on a file that I did not create the macro in. I see when opening the .rpy file in a text editor that the macro is defining the name of the .odb file as the name of the file that was open when I made the program. How can I make this file name be the name of whichever .odb file I currently have open?
Also Abaqus seems to add in the part name when calculating U2 and RF2, which will again cause me some more headache (part name doesn't stay consistent across .cae/.odb files. Any way to change that behavior?
def XY_Plots():
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step
import interaction
import load
import mesh
import optimization
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
session.linkedViewportCommands.setValues(_highlightLinkedViewports=False)
odb = session.odbs['Model1.odb']
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('RF',
NODAL, ((COMPONENT, 'RF2'), )), ('U', NODAL, ((COMPONENT, 'U2'), )), ),
nodeSets=('Loading Node', ))
xy1 = session.xyDataObjects['U:U2 PI: Packer End Connection 1-2 N: 12']
xy2 = session.xyDataObjects['RF:RF2 PI: Packer End Connection 1-2 N: 12']
xy3 = combine(-xy1, -2*xy2)
xy3.setValues(
sourceDescription='combine ( -"U:U2 PI: Packer End Connection 1-2 N: 12",-2*"RF:RF2 PI: Packer End Connection 1-2 N: 12" )')
tmpName = xy3.name
session.xyDataObjects.changeKey(tmpName, 'XYData-1')
x0 = session.xyDataObjects['XYData-1']
session.writeXYReport(fileName='abaqus.rpt', xyData=(x0, ))
“The most successful people in life are the ones who ask questions. They’re always learning. They’re always growing. They’re always pushing.” Robert Kiyosaki
For my research I have to create the same XY plot with different data a painful number of times. I am trying to use an Abaqus macro to make my life easier, which seems to work great until I try to use it on a file that I did not create the macro in. I see when opening the .rpy file in a text editor that the macro is defining the name of the .odb file as the name of the file that was open when I made the program. How can I make this file name be the name of whichever .odb file I currently have open?
Also Abaqus seems to add in the part name when calculating U2 and RF2, which will again cause me some more headache (part name doesn't stay consistent across .cae/.odb files. Any way to change that behavior?
def XY_Plots():
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step
import interaction
import load
import mesh
import optimization
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
session.linkedViewportCommands.setValues(_highlightLinkedViewports=False)
odb = session.odbs['Model1.odb']
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('RF',
NODAL, ((COMPONENT, 'RF2'), )), ('U', NODAL, ((COMPONENT, 'U2'), )), ),
nodeSets=('Loading Node', ))
xy1 = session.xyDataObjects['U:U2 PI: Packer End Connection 1-2 N: 12']
xy2 = session.xyDataObjects['RF:RF2 PI: Packer End Connection 1-2 N: 12']
xy3 = combine(-xy1, -2*xy2)
xy3.setValues(
sourceDescription='combine ( -"U:U2 PI: Packer End Connection 1-2 N: 12",-2*"RF:RF2 PI: Packer End Connection 1-2 N: 12" )')
tmpName = xy3.name
session.xyDataObjects.changeKey(tmpName, 'XYData-1')
x0 = session.xyDataObjects['XYData-1']
session.writeXYReport(fileName='abaqus.rpt', xyData=(x0, ))
“The most successful people in life are the ones who ask questions. They’re always learning. They’re always growing. They’re always pushing.” Robert Kiyosaki