This workflow enables you to read the stress tensors for a range of time steps from an analysis, to average those elemental nodal tensors to a nodal location, and to compute it's Von Mises equivalent. This workflow is an example of how to use the time scoping pin. This pin expects a scoping input and enables you to choose the time or frequency sets of the results.
import mech_dpf import Ans.DataProcessing as dpf my_data_sources = dpf.DataSources(analysis.ResultFileName) my_time_scoping = dpf.Scoping() my_time_scoping.Ids = [1] # the first set s_eqv_op = dpf.operators.result.stress_von_mises() s_eqv_op.inputs.requested_location.Connect('Nodal') s_eqv_op.inputs.data_sources.Connect(my_data_sources) s_eqv_op.inputs.time_scoping.Connect(my_time_scoping) dpf_workflow = dpf.Workflow() dpf_workflow.Add(s_eqv_op) dpf_workflow.SetOutputContour(s_eqv_op) dpf_workflow.Record('wf_id', True) this.WorkflowId = dpf_workflow.GetRecordedId()

Beam Result Evaluation
To enable result evaluation on beams, you need to add the following three lines to the script:
s_eqv_op.inputs.requested_location.Connect('ElementalNodal') s_eqv_op.inputs.read_beams.Connect(True) dpf_workflow.SetOutputName(my_data_sources, "my_data_source")
