How to export Time-History data via Python Code when running in BACKGROUND (Parametric Study)?
Hi everyone,
I'm running a parametric study using the Parameter Set in Workbench (Ansys 2025 R2) and I need some help extracting data.
The Goal: Export the time-history data (Force and Deformation for all substeps) to a CSV/TXT file for each Design Point.
The Setup:
My geometry is updated via SpaceClaim for each DP, so the topology changes. Because of this, I'm strictly using Named Selections to scope my results.
I've tried using User Defined Results (Expression: UY) and Deformation Probes scoped to these Named Selections.
I'm using a Python Code object in the tree (Target Callback: After Post) to export the data.
The Problem:
When I run the Design Points, Mechanical runs in the background (GUI is closed). Because the GUI is closed, calling resultado.TabularData or using resultado.ExportToTextFile() throws an error (e.g., 'UserDefinedResult' object has no attribute 'TabularData' or Index out of range). The API seems to disable tabular extraction for these objects when running in batch mode.
The Question:
What is the simplest, most robust way to extract this time-history data using Python when the Mechanical GUI is closed? Do I have to dig into DPF, or is there a simpler workaround to get the Tabular Data out of a Named Selection while in background mode?
Any tips or snippets would save my life. Thanks!