Skip to main content

Prime Mesh Python client library 2025 R2 SP04

export_stl

Last update: 20.02.2026

FileIO.export_stl(file_name, params)

Export an STL file.

  • Parameters:

    file_name : Path to the STL file on disk.

    params : Parameters for exporting the STL file.

  • Returns:

    FileWriteResults : Results from exporting the STL file.

  • Return type:

    FileWriteResults

Notes

This method does not support Unicode paths.

Examples

>>> import ansys.meshing.prime as prime
>>> model = prime.launch_prime().model
>>> fileio = prime.FileIO(model=model)
>>> out_file_path = r"/tmp/output.stl"
>>> part_ids = [part.id for part in model.parts]
>>> export_stl_params=prime.ExportSTLParams(model=model,part_ids=part_ids)
>>> results = fileio.export_stl(out_file_path,export_stl_params)

Connect with Ansys