How to write a plug-in to automatically generate a History output XY plot in Abaqus?

I want to write a plug-in to automatically plot the XY history plot and set the styles.

But there's a specific outputVariableName ,shown below in line numbered 6, as I record the macro when I  plot the XY history plot.

This variable hardcode the plug-in. So that I can't use this plug-in in other ODB files.

Is there any method to get the  outputVariableName variable automatically in each ODB file

By far I can only fetch the reference point number,"94", from historyRegion object.

But I don't know where to fetch the NSET name,"DISP".

  1. # assign odb file from current viewport
  2.     currentViewport = session.viewports[session.currentViewportName]
  3.     odb = currentViewport.displayedObject
  4.  
  5.     xy1 = xyPlot.XYDataFromHistory(odb=odb,
  6.         outputVariableName="Spatial displacement: U3 PI: rootAssembly Node 94 in NSET DISP",steps=('Step-2', ), )
  7.    
  8.     c1 = session.Curve(xyData=xy1)
  9.     xyp = session.XYPlot('XYPlot-1')
  10.     chartName = xyp.charts.keys()[0]
  11.     chart = xyp.charts[chartName]
  12.     chart.setValues(curvesToPlot=(c1, ), )
  13.     session.viewports['Viewport: 1'].setValues(displayedObject=xyp)
  14.     session.charts['Chart-1'].majorAxis1GridStyle.setValues(show=True)
  15.     session.charts['Chart-1'].minorAxis1GridStyle.setValues(show=True)
  16.     session.charts['Chart-1'].minorAxis2GridStyle.setValues(show=True)
  17.     session.charts['Chart-1'].majorAxis2GridStyle.setValues(show=True)
  18.     session.charts['Chart-1'].axes2[0].labelStyle.setValues(
  19.         font='-*-verdana-medium-r-normal-*-*-180-*-*-p-*-*-*')
  20.     session.charts['Chart-1'].axes2[0].titleStyle.setValues(
  21.         font='-*-arial-medium-r-normal-*-*-180-*-*-p-*-*-*')