Skip to content

Commit 95eb9b8

Browse files
committed
Merge remote-tracking branch 'origin/add_parameters_to_virtualcompliance' into add_parameters_to_virtualcompliance
2 parents b10caad + da137d3 commit 95eb9b8

File tree

8 files changed

+42
-4
lines changed

8 files changed

+42
-4
lines changed

.github/workflows/ci_cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
fail-fast: false
125125
matrix:
126126
os: [ubuntu-latest, windows-latest]
127-
python-version: ['3.10', '3.11', '3.12']
127+
python-version: ['3.10', '3.11', '3.12', '3.13']
128128
steps:
129129
- name: Build wheelhouse and perform smoke test
130130
uses: ansys/actions/build-wheelhouse@v9

doc/changelog.d/6109.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added automatic search in modeler getitem of FaceID and Edge Ids.

doc/changelog.d/6116.maintenance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Extend smoke tests with py313

doc/source/Getting_started/Installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ you pass as an argument the path of the Python interpreter.
148148
Linux support
149149
~~~~~~~~~~~~~
150150

151-
PyAEDT works with CPython 3.8 through 3.12 on Linux in AEDT 2022 R2 and later.
151+
PyAEDT works with CPython 3.8 through 3.13 on Linux in AEDT 2022 R2 and later.
152152
However, you must set up the following environment variables:
153153

154154
.. code::
@@ -161,7 +161,7 @@ Install offline from a wheelhouse
161161
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162162
Using a wheelhouse can be helpful if you work for a company that restricts access to external networks.
163163

164-
Wheelhouses for CPython 3.8, 3.9, 3.10, 3.11, and 3.12 are available in the releases for both Windows and Linux.
164+
Wheelhouses for CPython 3.10, 3.11, 3.12 and 3.13 are available in the releases for both Windows and Linux.
165165
From the `Releases <https://github.com/ansys/pyaedt/releases>`_
166166
page in the PyAEDT repository, you can find the wheelhouses for a particular release in its
167167
assets and download the wheelhouse specific to your setup.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.10",
2626
"Programming Language :: Python :: 3.11",
2727
"Programming Language :: Python :: 3.12",
28+
"Programming Language :: Python :: 3.13",
2829
"Topic :: Software Development :: Libraries",
2930
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
3031
"Topic :: Scientific/Engineering :: Information Analysis",

src/ansys/aedt/core/modeler/cad/elements_3d.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ def __init__(self, object3d, objid, position=None):
190190
self.oeditor = object3d._oeditor
191191
self._position = position
192192

193+
@property
194+
def name(self):
195+
"""Name of the object."""
196+
return self._object3d.name
197+
193198
@property
194199
def position(self):
195200
"""Position of the vertex.
@@ -239,6 +244,11 @@ def __init__(self, object3d, edge_id):
239244
self._object3d = object3d
240245
self.oeditor = object3d._oeditor
241246

247+
@property
248+
def name(self):
249+
"""Name of the object."""
250+
return self._object3d.name
251+
242252
@property
243253
def segment_info(self):
244254
"""Compute segment information using the object-oriented method (from AEDT 2021 R2
@@ -415,6 +425,11 @@ def __init__(self, object3d, obj_id):
415425
self._object3d = object3d
416426
self._is_planar = None
417427

428+
@property
429+
def name(self):
430+
"""Name of the object."""
431+
return self._object3d.name
432+
418433
@property
419434
def oeditor(self):
420435
"""Oeditor Module."""

src/ansys/aedt/core/modeler/cad/primitives.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def __getitem__(self, partId) -> Object3d:
229229
return self.objects[partId]
230230
except KeyError:
231231
pass
232+
232233
try:
233234
return self.user_defined_components[partId]
234235
except KeyError:
@@ -237,10 +238,25 @@ def __getitem__(self, partId) -> Object3d:
237238
return self.planes[partId]
238239
except KeyError:
239240
pass
241+
240242
try:
241243
return self.points[partId]
242244
except KeyError:
243-
return
245+
pass
246+
if isinstance(partId, int):
247+
try:
248+
obj_name = self.oeditor.GetObjectNameByFaceID(partId)
249+
if obj_name:
250+
return FacePrimitive(self.objects[obj_name], partId)
251+
except AttributeError: # pragma: no cover
252+
pass
253+
try:
254+
obj_name = self.oeditor.GetObjectNameByEdgeID(partId)
255+
if obj_name:
256+
return EdgePrimitive(self.objects[obj_name], partId)
257+
except Exception: # pragma: no cover
258+
pass
259+
return
244260

245261
def __init__(self, app, is3d=True):
246262
self._app = app

tests/system/general/test_02_3D_modeler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,3 +1220,7 @@ def test_clean_objects_name(self):
12201220

12211221
assert self.aedtapp.modeler.get_matched_object_name("Part0")
12221222
assert self.aedtapp.modeler.get_matched_object_name("Part1")
1223+
1224+
def test_64_id(self):
1225+
box_0 = self.aedtapp.modeler.create_box([0, 0, 0], [10, 10, 10], name="Object_Part_ids")
1226+
assert self.aedtapp.modeler[box_0.faces[0].id].name == box_0.name

0 commit comments

Comments
 (0)