How to automaticly open workbench and import a geometry file (e.g.spacecliam) to mechiancal

I want to use pyansys to automatic run workbench and import a geoemtry file (generated by spaceclaim) in a local folder ?
Answers
-
Hi @yangming . If you're using Workbench, SpaceClaim, and Mechanical, you would be using Product Scripting, and not PyAnsys. For importing a geometry file in SpaceClaim, this post should help: https://discuss.ansys.com/discussion/965/import-geometry-in-spaceclaim-from-project-schematic
0 -
@yangming PyAnsys does not provide any access to WB project schematic.
If what you want is to run WB in batch mode, you'll find several examples in the forum:
https://discuss.ansys.com/discussion/1365/how-to-run-a-workbench-journal-in-a-batch-mode-without-command-prompt-pop-up
https://discuss.ansys.com/discussion/comment/1480#Comment_1480
https://discuss.ansys.com/discussion/comment/1595#Comment_1595If you want to use PyAnsys, what you need is to use PyMechanical. There are some examples in the doc.
0 -
The 2024R1 release of Workbench (due January 2024) will include a gRPC API. This will allow a Python client library (PyWorkbench) to be published soon. Watch here for updates:
https://developer.ansys.com/docsIn the meantime, the workaround is to run Workbench as a subprocess with a startup script (-R or -X), as @Pernelle Marone-Hitz has described. You can use -I command in conjunction with -R to open Workbench in interactive mode and pass control to the user after your script ends (if that is your goal?). See https://discuss.ansys.com/discussion/comment/1595#Comment_1595 for other options.
0