19.15.5.8. Migrating to New Python Result

Migrating from old Script Defined Result (2021R2 and older) to new Python Result

The older Script Defined Result object (from version 2020R2) will not work in the newer version of ANSYS Mechanical (2022R1 or beyond).

Old Script Defined Result from 2021R1 and older, you must manually insert new Python Result objects and recreate their scripts and workflows. You can either use the new templates to create a new script from scratch or simply copy the old script and paste it (with proper indentation) within the define_dpf_workflow(analysis) section (PART 3) of the new Python Result script. You also need to add this line at the end of your script within the section.

this.WorkflowId = wf.GetRecordedId()

Old Python Result from 2021R2, you must manually remove the numerical suffix from the auto generated method post_started(sender, analysis).

For example, if the first part of your script is:

def post_started_132(sender, analysis):# Do not edit this line

You need to change it to:

def post_started(sender, analysis):# Do not edit this line

To use the retrieving results from the table/chart feature, you also need to:

  1. Include the callback function table_retrieve_result (value) provided in the default template, and:

  2. Change the record workflow line from dpf_workflow.Record('wf_id', True) to dpf_workflow.Record('wf_id', False).