Feb-08-2022, 09:21 AM
Hello,
I'm trying to create a code for postprocessing some FEA results by using a Python script associated with Abaqus scripting.
my current code is as follow
The line where I have a problem is the last one ( chart.setValues(curvesToPlot=(c1, c2, ), )). how can I add more variables (c3, c4, c5, ...) when the user gives the "Number of FEA"?
I was thinking about using a dictionary or a function but I couldn't make it work.
Thanks for your help
I'm trying to create a code for postprocessing some FEA results by using a Python script associated with Abaqus scripting.
my current code is as follow
if Number_Fea == 1: xy1 = session.xyDataObjects['RF : %s' %Cases[0]] c1 = session.Curve(xyData=xy1) chart.setValues(curvesToPlot=(c1, ), ) if Number_Fea == 2: xy1 = session.xyDataObjects['RF : %s' %Cases[0]] xy2 = session.xyDataObjects['RF : %s' %Cases[1]] c1 = session.Curve(xyData=xy1) c2 = session.Curve(xyData=xy2) chart.setValues(curvesToPlot=(c1, c2, ), )My question: I would like to loop through my code without repeating these lines of code for each "Number_Fea" value.
The line where I have a problem is the last one ( chart.setValues(curvesToPlot=(c1, c2, ), )). how can I add more variables (c3, c4, c5, ...) when the user gives the "Number of FEA"?
I was thinking about using a dictionary or a function but I couldn't make it work.
Thanks for your help