Is it possible to retrieve geometry parameters using PyMechanical?
Hello Team,
I have a SpaceClaim file that contains Named Selections and a single parameter. I would like to perform some analysis interactively via a web application using PyMechanical. Is there a way to retrieve the SpaceClaim parameter and integrate it into the web application? If so, could you please guide me on how to proceed?
Thank you!
Answers
-
If you are using mechanical embedding instance then you can not control parameters via PyMechanical.
In that case, I will suggest you control spaceclaim separately via PyAnsysGeometry.
For changing the values of SpaceClaim Parameter, you can use https://geometry.docs.pyansys.com/version/stable/api/ansys/geometry/core/modeler/Modeler.html#Modeler.run_discovery_script_file, for running spaceclaim script.
Once updated, you must import geometry in mechanical instance.
1 -
Dear @Rajesh Meena Thanks for your quick guidance.
Here, I'm creating parameters for an existing geometry in Ansys SpaceClaim manually. I'm not creating geometry from scratch.So, any suggestions from here, how to proceed?
0 -
@Naveen Kumar Begari It should be same even if you want to use already parametrized geometery and saved as scdocx.
- Import scdocx in SpaceClaim via PyAnsys Geometry.
- update the parameter using run_discovery_script_file and save the scdoc.
- Load the scdoc in Mechanical via PyMechanical
- Automate the remaining set up.
In case your set up in mechanical is also not completely automated then I would suggest that you define a template project in mechanical where everything is defined using named selections coming from SpaceClaim.
1 -
@Rajesh Meena Sure, we will give it a try with the provided inputs. If we are unable to achieve the expected workflow, we will reach out again tomorrow.
Thank you!!0