User guide#

This section describes how to start a session with the PyAdditive client and run simulations.

Start a session#

You can start a session with the PyAdditive client in multiple ways. For example, you can start a local session or a remote session.

Before you can visualize the results of a parametric additive simulation, you must instantiate a parametric study.

Start a local session#

Instantiating an Additive object starts the local installation of the Additive server:

import ansys.additive.core as pyadditive
from ansys.additive.core.parametric_study import ParametricStudy
from ansys.additive.widgets import display

study = ParametricStudy("demo-study")

# Display the empty study as a table
display.show_table(study)

Start a remote session#

Start a remote session by specifying the host name and port of the server:

import ansys.additive.core as pyadditive
from ansys.additive.core.parametric_study import ParametricStudy
from ansys.additive.widgets import display

additive = pyadditive.Additive(host="additiveserver.mydomain.com", port=12345)
study = ParametricStudy("demo-study")

# Display the empty study as a table
display.show_table(study)

Use alternative startup methods#

The Additive class in the PyAdditive API provides additional session startup methods that you can use. For more information, see Additive in the PyAdditive API reference documentation.

Run simulations#

Once a session is started, you can run simulations.

Basic usage#

This code shows how to import PyAdditive-Widgets and use some basic capabilities to visualize PyAdditive-generated results of a parametric study as a table:

from ansys.additive.core.parametric_study import ParametricStudy
from ansys.additive.widgets import display

study = ParametricStudy("demo-study")

bead_length = 0.005
powers = [50, 250, 700]
scan_speeds = [0.35, 1, 2.4]
layer_thicknesses = [30e-6, 50e-6]
heater_temperatures = [80, 100]
beam_diameters = [2e-5]

study.generate_single_bead_permutations(
   "material",
   powers,
   scan_speeds,
   bead_length=bead_length,
   layer_thicknesses=layer_thicknesses,
   heater_temperatures=heater_temperatures,
   beam_diameters=beam_diameters,
)

# Display the study as a table with the generated single bead simulations
display.show_table(study)

Advanced usage#

The Examples section provides comprehensive examples of how to use PyAdditive-Widgets. For information on how to use PyAdditive for the Ansys Additive service, see the PyAdditive documentation.