Introduction
This blog post demonstrates how to automate support generation for Additive Manufacturing using Laser Powder Bed Fusion (LPBF) in Ansys Mechanical by leveraging a Python Code Object. Typically, setting up supports in Ansys involves several manual steps through the LPBF setup wizard—selecting the geometry, enabling support creation, and setting up the voxel mesh settings for both the part and the base plate. While this process works well for single studies, it becomes cumbersome and time-consuming when performing design studies involving multiple part orientations or when searching for the optimal build orientation that minimizes support volume. To address this challenge, a Python script can be used to streamline and automate support generation, making it significantly more efficient for iterative simulations and orientation optimization. In this blog we will use an example of a simple Gear Fork geometry and baseplate. Ansys version 2025R1 is used.The Example
We will look at the example on two levels. In the first one, we will use a few lines of code to automatically generate the supports. This python code is the basic block and can be developed to automate the entire process. This will be shown in the next level, where we will add more code lines to generate additional parameterizable details like support volume. The script can be further developed to automate steps like removing initial contacts, updating the body named selection for material assignment, updating the contact regions etc. Note from the Ansys help:Generated Supports are available only for parts meshed with Cartesian mesh (with voxelization option equal to yes or no). These supports generated by the Mechanical application are either automatically detected or user-defined. For automatic detection you specify an overhang angle (the default value is 45° to the horizontal X-Y plane) under which supports will be created. For user-defined supports you select individual element faces under which supports will be created. Supports are generated as elements vertically straight down from the overhanging portion of the build to the base, or to a lower portion of the model if it is in the way.
Level 1:
In workbench, double click on ‘AM LPBF Inherent Strain’ under Custom system or preferred analysis system. Import the Gear Fork geometry which includes part and base plate, and double click on model to open Mechanical. The steps below are suggested for manually setting up the simulation. However, if you prefer, use the LPBF setup wizard.In details of ‘AM Process’ in Tree, set the gear fork as part geometry and Base plate as base plate geometry (as shown in image below).