Note
Go to the end to download the full example code.
3D visualization#
The following example demonstrates how to visualize imported geometry in 3D.
Import the necessary libraries#
from ansys.mechanical.core import App
from ansys.mechanical.core.examples import delete_downloads, download_file
Initialize the embedded application#
app = App(globals=globals())
print(app)
Ansys Mechanical [Ansys Mechanical Enterprise]
Product Version:251
Software build date: 11/27/2024 09:34:44
Download and import the geometry file#
Download the geometry file
geometry_path = download_file("Valve.pmdb", "pymechanical", "embedding")
Define the model and import the geometry file
model = app.Model
geometry_import = model.GeometryImportGroup.AddGeometryImport()
geometry_import.Import(geometry_path)
Visualize the model in 3D#
app.plot()

Note
This visualization is currently available only for geometry and on version 24R2 or later
Clean up the files and app#
# Delete the downloaded files
delete_downloads()
# Close the app
app.close()
Total running time of the script: (0 minutes 16.042 seconds)