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".
- # assign odb file from current viewport
- currentViewport = session.viewports[session.currentViewportName]
- odb = currentViewport.displayedObject
- xy1 = xyPlot.XYDataFromHistory(odb=odb,
- outputVariableName="Spatial displacement: U3 PI: rootAssembly Node 94 in NSET DISP",steps=('Step-2', ), )
- c1 = session.Curve(xyData=xy1)
- xyp = session.XYPlot('XYPlot-1')
- chartName = xyp.charts.keys()[0]
- chart = xyp.charts[chartName]
- chart.setValues(curvesToPlot=(c1, ), )
- session.viewports['Viewport: 1'].setValues(displayedObject=xyp)
- session.charts['Chart-1'].majorAxis1GridStyle.setValues(show=True)
- session.charts['Chart-1'].minorAxis1GridStyle.setValues(show=True)
- session.charts['Chart-1'].minorAxis2GridStyle.setValues(show=True)
- session.charts['Chart-1'].majorAxis2GridStyle.setValues(show=True)
- session.charts['Chart-1'].axes2[0].labelStyle.setValues(
- font='-*-verdana-medium-r-normal-*-*-180-*-*-p-*-*-*')
- session.charts['Chart-1'].axes2[0].titleStyle.setValues(
- font='-*-arial-medium-r-normal-*-*-180-*-*-p-*-*-*')