ansys / pymechanical

Pythonic interface to Ansys Mechanical ™
https://mechanical.docs.pyansys.com/
MIT License
35 stars 18 forks source link

Pymechanical - multiple ModelImportSourceFilePath #912

Open ekostson opened 5 days ago

ekostson commented 5 days ago

🔍 Before submitting the issue

🐞 Description of the bug

Hello

In Pymechanical when we issue multiple mimp.ModelImportSourceFilePath='D:\DATA\SR\modelcdbrst_files\dp0\SYS-1\MECH\filecdb.cdb' mimp.Import()

(We need to do that to reimport new cdb and result files for different models and then save results images),

we get a crash and a dump file.

The same thing works fine inside the script console of the Standalone Mechanical Application (2024 R2) - so not sure why it crashes inside PyMechanical session.

All the best

Erik

📝 Steps to reproduce

Steps described above - import and reimport cdb files, and corresponding files (rst).

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

2024 R2

import ansys.mechanical.core as mech

work_dir = r'D:\DATA\SR' # where mechdat will be saved path_to_242 = r'C:\Program Files\ANSYS Inc\v242' app = mech.App(version=242) # starts a non-graphical Mechanical session within the python.exe globals().update(mech.global_variables(app))

mimp=Model.GeometryImportGroup.AddModelImport()

...

🐍 Which Python version are you using?

3.10

📦 Installed packages

PyMech
ekostson commented 4 days ago

@koubaa - dump file attached: AnsysWBDumpFile.dmp

koubaa commented 1 day ago

@ekostson can you please share the script in its entirety (including the relevant cdb)?