Converting CAD parts to pmdb in batch on Windows to import them on Linux

Hello, there are limitations for CAD import on Linux, I would like to create a small python script that would import the CAD in batch and export it as .pmdb so that I could then import it on Linux in Fluent Meshing.
Is it possible to do this with PyAnsys Geomerty?
I can do it with run_discovery_script_file
but I would like to avoid the need of 2 files for a 2-operation script.
The context is that I need to import NX prt files but there's no reader for them on Linux. So, if I can set up a script/workflow to convert the .prt files to .pmdb on Windows the .pmdb files can then be imported in Linux.
Best Answer
-
To Answer:
NX format is not handled yet with the GeometryService. However, you don't need to use PyAnsys Geometry and the native product script to achieve what you're looking for. You can natively load a prt file in Discovery and export it as pmdb through PyAnsys Geometry alone:
from ansys.geometry.core import Modeler from ansys.geometry.core import launch_modeler_with_discovery modeler = launch_modeler_with_discovery(product_version=251 , hidden=True) design = modeler.open_file(r"D:/test.prt") design.export_to_pmdb(r"D:/") modeler.exit()
You can also provide various import options when calling the
open_file
method. Seeand
for more information
Additionally, the following command might do what you want in the Discovery interface.
Workbench.Fluent.ExportPMDB(os.path.join(wrk_dir_CAD, "Final_Model.pmdb"))
1