I want to use pyansys to automatic run workbench and import a geoemtry file (generated by spaceclaim) in a local folder ?
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
Hi, @Pernelle Marone-Hitz
Actually, I even don't want to manually open ANSYS workbench, just to run stripting in Pyansys plafrom (consel, or jupter ....) to totally aumatic simulation for an easy case
@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-uphttps://discuss.ansys.com/discussion/comment/1480#Comment_1480https://discuss.ansys.com/discussion/comment/1595#Comment_1595
If you want to use PyAnsys, what you need is to use PyMechanical. There are some examples in the doc.
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/docs
In 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.