update_modeling_region#
- Layer.update_modeling_region(project, modeling_regions)#
Update one or more modeling regions in a specific project.
- Parameters:
- project: str
Name of the Sherlock project.
- modeling_regions
list
[dict
] Modeling regions to update. Each dictionary should contain:
- cca_name: str
Name of the CCA.
- region_id: str
Unique region ID of the modeling region.
- region_units: str
Units of the modeling region.
- model_mode: str
Mode that specifies how the region is used. Valid values are
Enabled
,Disabled
andExcluded
.
- shape: PolygonalShape|RectangularShape|SlotShape|CircularShape|PCBShape
The shape of the modeling region.
- pcb_model_props: dict[str, bool | float | str]
PCB model parameters consisting of these properties:
- export_model_type: str
The type of model to be generated for a given modeling region. Valid values are
Default
,Sherlock
,Sweep
andNone
.
- elem_order: str
The type of 3D elements to be created for the PCB in the modeling region. Valid values are
First_Order
,Second_Order
andSolid_Shell
.
- max_mesh_size: float
The maximum size of the mesh to be used in the region.
- max_mesh_size_units: str
Units for the maximum mesh size.
- quads_preferred: bool
Whether to generate quad-shaped elements when creating the mesh if true.
- trace_model_props: dict[str, float | str]
Trace model parameters consisting of these properties:
- trace_model_type: str
The specification of whether trace modeling should be performed within the region. Valid values are
Default
,Enabled
andDisabled
.
- elem_order: str, optional
The type of 3D elements to be created for the PCB in the modeling region. Valid values are
First_Order
,Second_Order
andSolid_Shell
.
- trace_mesh_size: float, optional
The maximum mesh size to be used in the region when trace modeling is enabled.
- trace_mesh_size_units: str, optional
Units for the maximum mesh size when trace modeling is enabled.
- region_id_replacement: str, optional
Represents a unique region id that will replace the existing regionId value during a modeling region update if a value exists.
- Returns:
- :
int
Status code of the response. 0 for success.
- Return type:
Examples
>>> from ansys.sherlock.core.launcher import launch_sherlock >>> sherlock = launch_sherlock() >>> sherlock.project.import_odb_archive( >>> "ODB++ Tutorial.tgz", >>> True, >>> True, >>> True, >>> project="Tutorial Project", >>> cca_name="Card", >>> ) >>> modeling_regions = [ >>> { >>> "cca_name": "Card", >>> "region_id": "Region001", >>> "region_units": "mm", >>> "model_mode": "Enabled", >>> "shape": PolygonalShape(points=[(0, 0), (1, 1)], rotation=0), >>> "pcb_model_props": { >>> "export_model_type": "Sherlock", >>> "elem_order": "Second_Order", >>> "max_mesh_size": 0.5, >>> "max_mesh_size_units": "mm", >>> "quads_preferred": True, >>> }, >>> "trace_model_props": { >>> "trace_model_type": "Enabled", >>> "elem_order": "Second_Order", >>> "trace_mesh_size": 0.1, >>> "trace_mesh_size_units": "mm", >>> }, >>> "region_id_replacement": "NewRegion001", >>> } >>> ] >>> result = sherlock.layer.update_modeling_region("Tutorial Project", modeling_regions)