We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Automatically Assigning Geometry Surface IDs for Automation Using PyAnsys

    • nethan1012
      Subscriber

      Hello,

      I am currently working on automating static structural analysis using PyAnsys. One of the challenges I’m facing is assigning boundary conditions: currently, I have to manually extract the surface IDs from the geometry using the GUI, and then hard-code these IDs into my Python script. This becomes inefficient and error-prone, especially when the geometry changes frequently.

      I would like to ask if there is a way to fully automate this process—specifically, to automatically detect and assign boundary conditions to surfaces in a specific direction (e.g., surfaces normal to a given axis) without manually inputting surface IDs.

      Any advice or guidance would be greatly appreciated.

      Thank you!

    • Dennis Chen
      Subscriber

      Hello, there's a really easy way to do this which is to call the python script one would write inside the GUI in Pyansys.   From inside the GUI, you can access each object through the access points and once the script is working.   You can access workbench via pyansys in batch mode and generate, run and extract results in the background without ever opening ansys. 

      I actually made a quick video about this here -

      &t=0s

      just a suggestion, hope it helps. 

Viewing 1 reply thread
  • You must be logged in to reply to this topic.