Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/1117.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sync control data related changes from ado
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "ansys-meshing-prime"
version = "0.10.0.dev2"
version = "0.10.0.dev3"
description = "PyPrimeMesh is a Python client to Ansys Prime Server, which delivers core Ansys meshing technology."
readme = "README.md"
requires-python = ">=3.10,<4"
Expand Down
71 changes: 71 additions & 0 deletions src/ansys/meshing/prime/core/controldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
from ansys.meshing.prime.autogen.primeconfig import ErrorCode
from ansys.meshing.prime.autogen.shellblcontrol import ShellBLControl
from ansys.meshing.prime.autogen.thinvolumecontrol import ThinVolumeControl
from ansys.meshing.prime.core.featurerecoverycontrol import (
FeatureRecoveryControl as _FRControl,
)
from ansys.meshing.prime.core.periodiccontrol import PeriodicControl
from ansys.meshing.prime.core.prismcontrol import PrismControl
from ansys.meshing.prime.core.sizecontrol import SizeControl
Expand Down Expand Up @@ -64,6 +67,7 @@ def __init__(self, model: Model, id: int, object_id: int, name: str):
self._wrapper_controls = []
self._mz_controls = []
self._size_controls = []
self._feature_controls = []
self._prism_controls = []
self._thin_volume_controls = []
self._volume_controls = []
Expand Down Expand Up @@ -144,6 +148,28 @@ def create_size_control(self, sizing_type: SizingType) -> SizeControl:
self._size_controls.append(new_size_control)
return new_size_control

def create_feature_recovery_control(self) -> _FRControl:
"""Create Feature Recovery control for wrap.

Returns
-------
_FRControl
Returns the feature recovery control.

Notes
-----
An empty feature recovery control is created on calling this API.

Examples
--------
>>> feature_recovery_control = model.control_data.create_feature_recovery_control()

"""
res = _ControlData.create_feature_recovery_control(self)
new_feature_recovery_control = _FRControl(self._model, res[0], res[1], res[2])
self._feature_controls.append(new_feature_recovery_control)
return new_feature_recovery_control

def create_prism_control(self) -> PrismControl:
"""Create a prism control.

Expand Down Expand Up @@ -261,6 +287,29 @@ def get_size_control_by_name(self, name: str) -> SizeControl:
return size_control
return None

def get_feature_recovery_control_by_name(self, name: str) -> _FRControl:
"""Get a feature recovery control by name.

Parameters
----------
name : str
Name of the feature recovery control.

Returns
-------
_FRControl
Feature recovery control.

Examples
--------
>>> fr_control = model.control_data.get_feature_recovery_control_by_name("_FRControl-1")

"""
for feature_recovery_control in self._feature_controls:
if feature_recovery_control.name == name:
return feature_recovery_control
return None

def get_prism_control_by_name(self, name: str) -> PrismControl:
"""Get a prism control by name.

Expand Down Expand Up @@ -356,6 +405,10 @@ def delete_controls(self, control_ids: Iterable[int]) -> DeleteResults:
if size_control.id == id:
self._size_controls.remove(size_control)
break
for feature_recovery_control in self._feature_controls:
if feature_recovery_control.id == id:
self._feature_controls.remove(feature_recovery_control)
break
for wrapper_control in self._wrapper_controls:
if wrapper_control.id == id:
self._wrapper_controls.remove(wrapper_control)
Expand Down Expand Up @@ -389,6 +442,9 @@ def delete_controls(self, control_ids: Iterable[int]) -> DeleteResults:
def _update_size_controls(self, c_data: List):
self._size_controls = [SizeControl(self._model, c[0], c[1], c[2]) for c in c_data]

def _update_feature_recovery_controls(self, c_data: List):
self._feature_controls = [_FRControl(self._model, c[0], c[1], c[2]) for c in c_data]

def _update_prism_controls(self, c_data: List):
self._prism_controls = [PrismControl(self._model, c[0], c[1], c[2]) for c in c_data]

Expand Down Expand Up @@ -468,6 +524,21 @@ def size_controls(self) -> List[SizeControl]:
"""
return self._size_controls

@property
def feature_recovery_controls(self) -> List[_FRControl]:
"""Get the feature recovery controls.

Returns
-------
List[SizeControl]
List of feature recovery controls.

Examples
--------
>>> feature_recovery_controls = model.control_data.feature_recovery_controls
"""
return self._feature_controls

@property
def volume_controls(self) -> List[VolumeControl]:
"""Get the volume controls.
Expand Down
Loading