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
Larz60+ write Feb-08-2022, 12:23 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use BBcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use BBcode tags on future posts.