How to run SpaceClaim Scripts from VSCode.
I was able to launch the Discovery software using PyAnsys' ansys.geometry.core in VSCode and execute a saved dscript with the following code. However, due to a bug in Discovery, I would like to pass arguments to SpaceClaim and execute a scscript. Is this possible?
from ansys.geometry.core import launch_modeler_with_discovery
modeler = launch_modeler_with_discovery()
output = modeler.run_discovery_script_file("ScriptingCode_Discovery\FileOpen.dscript")
print(output)
Comments
-
Hi @Yuuki,
Yes this would be possible. Your code would look as follows:
from ansys.geometry.core import launch_modeler modeler = launch_modeler("spaceclaim") output = modeler.run_discovery_script_file("ScriptingCode_Discovery\FileOpen.scscript", script_args=...)
In order to understand how to pass arguments to the script, please refer to the documentation: https://geometry.docs.pyansys.com/version/stable/api/ansys/geometry/core/modeler/Modeler.html#Modeler.run_discovery_script_file
1