1

I have defined the following in an attempt to export HISTORY OUTPUT data at specified nodes from abaqus odb file. It is not clear to me how to resolve this error. Any suggestions?

from odbAccess import

def main():
    odb=openOdb('name.odb')

    ['Spatial acceleration: A1 at Node 84735155 in NSET SENSOR1',
     'Spatial acceleration: A2 at Node 84735155 in NSET SENSOR2']
    results = []
    for i in range(len(new_list)):
        f=XYDataFromHistory(odb=odb, 
                            outputVariableName=new_list[i],
                            steps=('Step-4', ), name='test{}'.format(i) )
        results.append(f)

Error

  Traceback (most recent call last):
  File "odb_processing_SSD_acceleration_export_v4.py", line 66, in <module>
    main()
  File "odb_processing_SSD_acceleration_export_v4.py", line 32, in main
    f=XYDataFromHistory(odb=odb,
NameError: global name 'XYDataFromHistory' is not defined
shoggananna
  • 545
  • 5
  • 9
  • You did not import `odbAccess` module correctly. Use `from odbAccess import *`. You missed `*` there. – Satish Thorat Jan 20 '23 at 07:02
  • @SatishThorat: Thanks for this. Somehow the above script does not work but this snippet get its for me: acc = step4.historyRegions[l[i]].historyOutputs[j].data. However, it appears it only exports the real component of the complex value in this linear steady stead dynamic analysis with modal damping. Cant seem to get access to the MAGNITUDE. – shoggananna Jan 20 '23 at 07:16

1 Answers1

1

XYDataFromHistory(...) is Abaqus method that is a part of the session and xyPlot objects. Thus, you have to call it correctly in your code.

from odbAccess import *


def main():
    odb=openOdb('name.odb')

    ['Spatial acceleration: A1 at Node 84735155 in NSET SENSOR1',
     'Spatial acceleration: A2 at Node 84735155 in NSET SENSOR2']
    results = []
    for i in range(len(new_list)):
        f=session.XYDataFromHistory(odb=odb, 
                            outputVariableName=new_list[i],
                            steps=('Step-4', ), name='test{}'.format(i) )
        results.append(f)

or

from odbAccess import *


def main():
    odb=openOdb('name.odb')

    ['Spatial acceleration: A1 at Node 84735155 in NSET SENSOR1',
     'Spatial acceleration: A2 at Node 84735155 in NSET SENSOR2']
    results = []
    for i in range(len(new_list)):
        f=xyPlot.XYDataFromHistory(odb=odb, 
                            outputVariableName=new_list[i],
                            steps=('Step-4', ), name='test{}'.format(i) )
        results.append(f)
Mike
  • 191
  • 7