copy_modeling_region#

Layer.copy_modeling_region(project: str, copy_regions: list[dict[str, float | str]]) int#

Copy one or more modeling regions in a specific project.

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

  • copy_regions (list[dict[str, float | str]]) –

    Modeling regions to copy along with their corresponding “copy to” parameters. Each dictionary should contain:

    • cca_namestr

      Name of the CCA.

    • region_idstr

      Region ID of the existing modeling region to copy.

    • region_id_copystr

      Region ID of the modeling region copy. Must be unique.

    • center_xfloat

      The center x coordinate of the modeling region copy. Used for location placement in the Layer Viewer.

    • center_yfloat

      The center y coordinate of the modeling region copy. Used for location placement in the Layer Viewer.

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",
)
>>> modeling_regions = [
>>>     {
>>>         "cca_name": "Card",
>>>         "region_id": "Region001",
>>>         "region_id_copy": "RegionCopy001",
>>>         "center_x": 10.0,
>>>         "center_y": 20.0,
>>>     }
>>> ]
>>> result = sherlock.layer.copy_modeling_region("Tutorial Project", modeling_regions)