How to run Space Claim script by pyMechanical
Hi,
I've record some script by Space Claim for creating an easy model.
The script is like below
# Python Script, API Version = V22 # Sketch Circle plane = Plane.PlaneZX result = ViewHelper.SetSketchPlane(plane) origin = Point2D.Create(MM(0), MM(0)) result = SketchCircle.Create(origin, MM(25)) baseSel = SelectionPoint.Create(CurvePoint1) targetSel = SelectionPoint.Create(DatumPoint1) result = Constraint.CreateCoincident(baseSel, targetSel) # EndBlock # Solidify Sketch mode = InteractionMode.Solid result = ViewHelper.SetViewMode(mode, Info1) # EndBlock # Extrude 1 Face selection = Face1 options = ExtrudeFaceOptions() options.ExtrudeType = ExtrudeType.Add result = ExtrudeFaces.Execute(selection, MM(200), options, Info2) # EndBlock
Is there any way that could run the script by using pyMechanical?
mechanical = pymechanical.launch_mechanical mechanical.run_python_script(xxxxxx)
Can I fulfill mechanical.run_python_script
with the space claim script content?
My Ansys running environment is in Linux and version 2023 R1.
Tagged:
0
Comments
-
hello @wanghao
spaceclaim/discovery are not natively supported in linux, only windows. your best bet would be to investigate pyGeometry which can run headless on Linux. however, it still requires a license to run discovery/spaceclaim.
https://geometry.docs.pyansys.com/version/stable/getting_started/faq.html
moreover, i believe the lowest version which pyGeomtry supports is 2023 r2.0