ansys / ansys/pymechanical

Bug exporting Harmonic Acoustics results - Ansys Sound opened everytime "ExportToXMLFile" is called.

Open
#1,400 1 comment 0 reactions 0 assignees View on GitHub
ansys-mechanical-bug bug
Dominant language
Python
Stars
83
Forks
37
Avg merge
23h 48m
Merged PRs (30d)
25

Description

### 🔍 Before submitting the issue

- [x] I have searched among the existing issues
- [x] I am using a Python virtual environment

### 🐞 Description of the bug

Dear all,
I made a script to automatize a Harmonic analysis. I encounter an issue when trying to export the results of sound pressure level (In the GUI it would be Frequency response > Acoustics > Sound pressure level / in python: Ansys.ACT.Automation.Mechanical.Results.FrequencyResponseResults.AcousticSPLFrequencyResponse)

There is no option to export to text, I only find "ExportToXMLFile", and I can't locate the array of results to export manually.

THE BUG:
When ever ExportToXMLFile is called, either Ansys Sound gets opened or, in case it is not installed, an error message appears requesting me to click OK. The file is created (this is OK), but having many Ansys Sound sessions opening or having to click in a window every time I export a results makes the automatization impossible.

Image

Im running a doe (+100 cases) and exporting 30 results per case... that means either 3000 Ansys sound sessions open simultaneously or 3000 error messages to be clicked.

I understand this is a bug, but perhaps I'm just exporting it incorrectly. Please let me know if this is the case and thank you in advance.

### 📝 Steps to reproduce

Files required to reproduce the exact simulation are too big to be attached. In short:

#Run Harmonic analysis
analysis_100 = Model.AddHarmonicAcousticAnalysis()
solution = app.DataModel.GetObjectsByName("Solution")[0]
solution.Solve(True)

#Create result set and export
acoustic_spl = solution.AddAcousticSPLFrequencyResponse()
acoustic_spl.Location = selection
acoustic_spl..EvaluateAllResults()
acoustic_spl.ExportToXMLFile("output_file_name.xml")

### 💻 Which operating system are you using?

Windows

### 📀 Which ANSYS version are you using?

25.2

### 🐍 Which Python version are you using?

3.12

### 📦 Installed packages

```shell
aiohappyeyeballs==2.6.1
aiohttp==3.13.1
aiosignal==1.4.0
ansys-api-mechanical==0.1.3
ansys-mechanical-core==0.11.34
ansys-mechanical-stubs==0.1.6
ansys-pythonnet==3.1.0rc6
ansys-tools-path==0.7.3
ansys-tools-visualization-interface==0.12.1
appdirs==1.4.4
asttokens==3.0.0
attrs==25.4.0
certifi==2025.10.5
cffi==2.0.0
charset-normalizer==3.4.4
click==8.3.0
clr_loader==0.2.8
colorama==0.4.6
comm==0.2.3
contourpy==1.3.3
cycler==0.12.1
debugpy==1.8.17
decorator==5.2.1
executing==2.2.1
fonttools==4.60.1
frozenlist==1.8.0
grpcio==1.76.0
idna==3.11
ipykernel==7.1.0
ipython==9.6.0
ipython_pygments_lexers==1.1.1
jedi==0.19.2
jupyter_client==8.6.3
jupyter_core==5.9.1
kiwisolver==1.4.9
matplotlib==3.10.7
matplotlib-inline==0.2.1
more-itertools==10.8.0
msgpack==1.1.2
multidict==6.7.0
nest-asyncio==1.6.0
numpy==2.3.4
packaging==25.0
parso==0.8.5
pillow==12.0.0
platformdirs==4.5.0
pooch==1.8.2
prompt_toolkit==3.0.52
propcache==0.4.1
protobuf==5.29.5
psutil==7.1.2
pure_eval==0.2.3
pycparser==2.23
Pygments==2.19.2
pyparsing==3.2.5
python-dateutil==2.9.0.post0
pyvista==0.46.3
PyYAML==6.0.3
pyzmq==27.1.0
requests==2.32.5
scooby==0.10.2
six==1.17.0
stack-data==0.6.3
tornado==6.5.2
tqdm==4.67.1
traitlets==5.14.3
trame==3.12.0
trame-client==3.11.2
trame-common==1.0.1
trame-router==2.3.0
trame-server==3.8.0
trame-vtk==2.10.0
trame-vuetify==3.1.0
typing_extensions==4.15.0
urllib3==2.5.0
usd-core==25.8
vtk==9.5.2
wcwidth==0.2.14
websockets==15.0.1
wslink==2.5.0
yarl==1.22.0
```

Contributor guide

Open the contributing guide

Research direction

Start with the reported Harmonic Acoustic workflow and the AcousticSPLFrequencyResponse.ExportToXMLFile entry point in Ansys Mechanical 25.2, using the reproduction snippet as the first test. Verify repeated exports with and without Ansys Sound installed; done means XML files are still created without launching Ansys Sound or showing a blocking dialog.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.