get_example#

Desktop.get_example(example_name, folder_name='.')#

Retrieve the path to a built-in example project.

Parameters:
example_namestr

Name of the example for which the full path is desired.

folder_namestr, optional

Name of the subfolder in the "Examples" folder where the example having example_name can be found. The default is "." which points to self.install_path / "Examples"

Returns:
pathlib.Path

Return the path to the example file if found, otherwise None.

Examples

Create a copy of a built-in example.

>>> import shutil
>>> from ansys.aedt.core import Desktop
>>> from pathlib import Path
>>> working_folder = Path("C:") / "path" / "to" / "target_folder"  # Windows
>>> d = Desktop(version=252)
>>> example_path = d.get_example("5G_SIW_Aperture_Antenna")
>>> new_project = working_folder / example_path.name
>>> working_folder.mkdir(parents=True, exist_ok=True)
>>> shutil.copytree(example_path, new_project)  # Copy example to new working folder.