export_layer_image#

Layer.export_layer_image(project, cca_name, export_layers)#

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 – List of parameters for the export image specified. Each dictionary should contain:

Return type:

int

Returns:

:
int

Status code of the response. 0 for success.

Examples

>>> from ansys.sherlock.core import launcher
>>> sherlock, install_dir = launcher.launch_and_connect(transport_mode="wnua")
>>> 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)