Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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/7264.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve consistency
26 changes: 25 additions & 1 deletion src/ansys/aedt/core/modeler/cad/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -4443,7 +4443,7 @@ def create_faceted_bondwire_from_true_surface(
str
Name of the bondwire created.
"""
old_bondwire = self.get_object_from_name(assignment)
old_bondwire = self.get_objects_by_name(assignment)[0]
if not old_bondwire:
return False
edges = old_bondwire.edges
Expand Down Expand Up @@ -7462,6 +7462,30 @@ def get_obj_id(self, assignment):
return self.objects_by_name[assignment].id
return None

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

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

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

"""
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

@pyaedt_function_handler()
def get_object_from_name(self, assignment):
"""Return the object from an object name.
Expand Down
Loading