Skip to main content

Prime Mesh Python client library 2024 R1 SP1

Interactive graphics using PyVista

Last update: 17.07.2025

PyPrimeMesh provides support for interactive graphical visualisation using PyVista if this package is installed as a dependency.

This code shows how to display the model using the Graphics class:

>>> from ansys.meshing.prime.graphics import Graphics
>>> import ansys.meshing.prime as prime
>>> display = Graphics(model)
>>> display()

graphics

Entire model displayed

Using the ScopeDefinition class allows you to limit the display to particular regions of the model:

>>> # display the first part only
>>> display(scope=prime.ScopeDefinition(model, part_expression=model.parts[0].name))

graphics_part

Single part displayed

Selections can be made of displayed objects. If selections in the window are made, information about them can be printed to the console. Selections can also be hidden.

These graphics buttons are provided to help navigate the model and to carry out basic verifications:

![graphics_buttons(/sites/default/files/git_ansys/primemesh_2024r1_sp1_2/graphics_buttons(2).png)

Graphics buttons

Connect with Ansys