ansys / pyansys-geometry

A Python wrapper for Ansys Geometry Services
https://geometry.docs.pyansys.com/
MIT License
36 stars 9 forks source link

Export to .pmdat fails #1295

Open greschd opened 3 days ago

greschd commented 3 days ago

🔍 Before submitting the issue

🐞 Description of the bug

The following STEP file ply_boundaries.step.txt [1] cannot be loaded and then exported to the PMDAT format.

The following exception occurs:

CRITICAL -  -  logger - handle_exception - Uncaught exception
Traceback (most recent call last):
  File "<script_location>\pmdat_export_error.py", line 5, in <module>
    design.export_to_pmdb(".")
  File "<venv_location>\lib\site-packages\ansys\geometry\core\designer\design.py", line 474, in export_to_pmdb
    self.download(file_location, DesignFileFormat.PMDB)
  File "<venv_location>\lib\site-packages\ansys\geometry\core\errors.py", line 98, in wrapper
    raise GeometryExitedError(
ansys.geometry.core.errors.GeometryExitedError: Geometry service connection terminated: Could not find file '<TEMPDIR>\2a350bea-f124-4461-97c6-2aeb0781eb75.pmdb'.

[1] renamed to .txt to make Github happy

📝 Steps to reproduce

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

2025R1

🐍 Which Python version are you using?

3.10

📦 Installed packages

aiohttp==3.9.5
aiosignal==1.3.1
ansys-api-dbu==0.3.3
ansys-api-geometry==0.4.4
ansys-geometry-core==0.6.5
ansys-tools-path==0.6.0
ansys-tools-visualization-interface==0.2.6
appdirs==1.4.4
async-timeout==4.0.3
attrs==23.2.0
beartype==0.18.5
certifi==2024.7.4
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.2.1
cycler==0.12.1
flexcache==0.3
flexparser==0.3.1
fonttools==4.53.0
frozenlist==1.4.1
grpcio==1.64.1
grpcio-health-checking==1.64.1
idna==3.7
kiwisolver==1.4.5
matplotlib==3.9.1
more-itertools==10.3.0
msgpack==1.0.8
multidict==6.0.5
numpy==2.0.0
packaging==24.1
pillow==10.4.0
Pint==0.24.1
platformdirs==4.2.2
pooch==1.8.2
protobuf==5.27.2
pyparsing==3.1.2
python-dateutil==2.9.0.post0
pyvista==0.43.10
requests==2.32.3
scipy==1.14.0
scooby==0.10.0
semver==3.0.2
six==1.16.0
trame==3.6.3
trame-client==3.2.1
trame-server==3.0.3
trame-vtk==2.8.9
trame-vuetify==2.6.1
typing_extensions==4.12.2
urllib3==2.2.2
vtk==9.3.1
websockets==12.0
wslink==2.1.1
yarl==1.9.4
RobPasMue commented 3 days ago

Hmm seems like you are using the local version of the Geometry Service (meaning, it is on your filesystem). Could you try running the script with the following modification?

https://geometry.docs.pyansys.com/version/0.6/api/ansys/geometry/core/modeler/Modeler.html#Modeler.open_file

design = modeler.open_file("ply_boundaries.step", upload_to_server=False)
design.export_to_pmdb()
RobPasMue commented 3 days ago

Nonetheless it seems like the export/download API is the one failing... Let's give it a try to

https://geometry.docs.pyansys.com/version/0.6/api/ansys/geometry/core/designer/design/Design.html#Design.save

try calling

design.save("ply_boundaries.pmdb")

Fingers crossed...

greschd commented 3 days ago

upload_to_server=False

Produces the same error

design.save("ply_boundaries.pmdb")

Produces the following error:

ansys.geometry.core.errors.GeometryExitedError: Geometry service connection terminated: Path cannot be the empty string or all whitespace.

Can you reproduce the issue with the STEP file above? Maybe I just got a bad daily build.

Otherwise, I suspect it's specific to this file. With another STEP file the original code works, but the design.save variant produces the same exception. On the original file, export_to_fmd also works.