pythonabaqus

Looping over all XY plots in Abaqus Viewer


I have a script that does several cosmetic operations on XY plot in Abaqus Viewer. The problem is that the script takes the name of a particular plot and can't be used for all arbitrarily named plots created during the session:

session.charts['Chart-1'].axes1[0].titleStyle.setValues(
    font='-*-verdana-bold-r-normal-*-*-140-*-*-p-*-*-*')
session.curves['_temp_1'].lineStyle.setValues(thickness=0.8)
session.charts['Chart-1'].axes1[0].axisData.setValues(useSystemTitle=False,
    title='Time [s]')

I know that I need a for loop to loop over all charts (and their curves) currently available in the session. However, I have very limited experience with Python scripting and I'm not sure how to do it properly. Can you tell me how to define the for loop in this case?


Solution

  • It looks like your post was overlooked. You have probably come up with the solution in the meantime, but nevertheless. You should partly modify your script to loop over all the available chars:

    for chart_key in session.charts.keys(): 
       session.charts[chart_key].axes1[0].titleStyle.setValues(font='-*-verdana-bold-r-normal-*-*-140-*-*-p-*-*-*') 
       session.curves['_temp_1'].lineStyle.setValues(thickness=0.8) 
       session.charts[chart_key].axes1[0].axisData.setValues(useSystemTitle=False,
        title='Time [s]')