export_layer_image#

Layer.export_layer_image(project: str, cca_name: str, export_layers: list[dict[str, bool | int | str | list]]) int#

Export one or more 2D Layer Viewer images from a project CCA.

Parameters:
  • project (str) – Name of the Sherlock project.

  • cca_name (str) – Name of the CCA.

  • export_layers (export_layer_image_info) –

    List of parameters for the export image specified. Each dictionary should contain:

    • components_enabled: bool, optional

      Displays the components in the export image. Default to true when not provided.

    • labels_enabled: bool, optional

      Displays the component reference designators in the export image. Default to true when not provided.

    • leads_enabledbool, optional

      Displays the component leads and solder balls in the export image. Default to true when not provided.

    • axes_enabledbool

      Displays the x and y axes in the export image.

    • grid_enabledbool

      Displays a grid in the export image.

    • layer_infos: list[dict[enum, list]]

      The layers as seen in the Layer Viewer for the given project CCA. Each dictionary should contain:

      • ”layer_folder”: enum, layer_folder enum.

      • ”layers”: list, list of names of layers under this folder

    • file_pathstr

      Full file path of the export image.

    • image_heightint

      The export image height.

    • image_widthint

      The export image width.

    • overwrite_existing_filebool

      If the file path already exists, overwrite the file if this is set to true.

Returns:

Status code of the response. 0 for success.

Return type:

int

Example

>>> from ansys.sherlock.core.launcher import launch_sherlock
>>> sherlock = launch_sherlock()
>>> sherlock.project.import_odb_archive(
    "ODB++ Tutorial.tgz",
    True,
    True,
    True,
    True,
    project="Tutorial Project",
    cca_name="Card"
)
>>> layer_infos = [
    { "layer_folder": "Components",
      "layers": ["comp-top"]},
    { "layer_folder": "Harmonic_Vibe",
      "layers":["HV Disp @ 203.39 Hz"]}
    ]
>>> export_layers = [
>>> {
    "components_enabled": True,
    "labels_enabled": True,
    "leads_enabled": True,
    "axes_enabled": True,
    "grid_enabled": True,
    "layer_infos": layer_infos,
    "file_path": "C:\\Users\\user_id\\Downloads\\SH-image.jpg",
    "image_height": 600,
    "image_width": 800,
    "overwrite_existing_file": True
>>> }
>>> ]
>>> sherlock.layer.export_layer_image("Tutorial Project", "Card", export_layers)