Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
341109e
Improve consistency
Devin-Crawford Feb 15, 2026
132a4ee
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Feb 15, 2026
0c9ac43
chore: adding changelog file 7264.added.md [dependabot-skip]
pyansys-ci-bot Feb 15, 2026
99fbbcc
Reinstate get_object_from_name
Devin-Crawford Feb 15, 2026
22d3c40
Merge remote-tracking branch 'origin/fix/7257_improve_consistency_get…
Devin-Crawford Feb 15, 2026
e6b8b5d
Merge branch 'main' into fix/7257_improve_consistency_get_object
Devin-Crawford Feb 15, 2026
c72051e
Update src/ansys/aedt/core/modeler/cad/primitives.py
Samuelopez-ansys Feb 15, 2026
761ff53
Update src/ansys/aedt/core/modeler/cad/primitives.py
Samuelopez-ansys Feb 15, 2026
239e295
Merge branch 'main' into fix/7257_improve_consistency_get_object
Samuelopez-ansys Feb 15, 2026
285e372
Update material value to allow file assignment
Devin-Crawford Feb 18, 2026
821881d
Merge remote-tracking branch 'origin/fix/7257_improve_consistency_get…
Devin-Crawford Feb 18, 2026
9df6acd
CHORE: Auto fixes from pre-commit hooks
pre-commit-ci[bot] Feb 18, 2026
350e906
Apply suggestion from @SMoraisAnsys
Devin-Crawford Feb 20, 2026
033a5eb
Merge branch 'main' into fix/7257_improve_consistency_get_object
Devin-Crawford Feb 20, 2026
8f2737d
Apply suggestion from @Devin-Crawford
Samuelopez-ansys Mar 18, 2026
892febf
add test
Samuelopez-ansys Mar 18, 2026
301bcc9
Fix conflicts
Samuelopez-ansys Mar 18, 2026
f69249e
Fix codacy
Samuelopez-ansys Mar 18, 2026
1995f81
FIX: improve type hints for get_objects_by_name and get_object_from_n…
Samuelopez-ansys Mar 22, 2026
518f585
Merge branch 'main' into fix/7257_improve_consistency_get_object
Samuelopez-ansys Mar 22, 2026
22989a7
FIX: improve error handling and add validation for material value fil…
Samuelopez-ansys Mar 22, 2026
a141ea2
FIX: enhance get_objects_by_name method to support wildcard patterns …
Samuelopez-ansys Mar 22, 2026
0be6151
Merge branch 'main' into fix/7257_improve_consistency_get_object
Samuelopez-ansys Mar 22, 2026
81056ce
Merge branch 'main' into fix/7257_improve_consistency_get_object
SMoraisAnsys Mar 23, 2026
52b5610
Update src/ansys/aedt/core/application/design.py
Samuelopez-ansys Mar 23, 2026
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/7264.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve consistency
21 changes: 13 additions & 8 deletions src/ansys/aedt/core/modeler/cad/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -7463,23 +7463,28 @@ def get_obj_id(self, assignment):
return None

@pyaedt_function_handler()
def get_object_from_name(self, assignment):
"""Return the object from an object name.
def get_objects_by_name(self, assignment, case_sensitive: bool = True):
"""Return the objects given a search string.

Parameters
----------
assignment : str
Name of the object.
String used to filter by object names..
case_sensitive : bool, optional
Whether the string is case-sensitive. The default is ``True``.

Returns
-------
:class:`ansys.aedt.core.modeler.cad.object_3d.Object3d`
3D object returned.
list of class:`ansys.aedt.core.modeler.cad.object_3d.Object3d`
Returns a list of objects whose names contain the
search string..

"""
if assignment in self.object_names:
# object_id = self.get_obj_id(objname)
return self.objects[assignment]
if case_sensitive:
return [o for name, o in self.objects_by_name.items() if assignment in name]
else:
return [o for name, o in self.objects_by_name.items() if assignment.lower() in name.lower()]
return None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is required as, by default, every python function return None


@pyaedt_function_handler()
def get_objects_w_string(self, string_name, case_sensitive: bool = True):
Expand Down
Loading