get_objects_by_name#

Modeler3D.get_objects_by_name(assignment: str, case_sensitive: bool = True) list[Object3d]#

Return the objects whose names match a wildcard pattern.

The * character acts as a wildcard that matches any sequence of characters (including none). The matching mode is inferred automatically from the position of * in assignment:

Parameters:
assignmentstr

Wildcard pattern to match against object names. Use * as a wildcard for any sequence of characters.

case_sensitivebool, optional

Whether the match is case-sensitive. The default is True.

Returns:
list of ansys.aedt.core.modeler.cad.object_3d.Object3d

Objects whose names satisfy the pattern.

Examples

# Exact match >>> objs = modeler.get_objects_by_name(“Patch_1”)

# All objects whose name starts with “Substrate” >>> objs = modeler.get_objects_by_name(“Substrate*”)

# All objects whose name ends with “_gnd” >>> objs = modeler.get_objects_by_name(”*_gnd”)

# All objects whose name contains “patch” >>> objs = modeler.get_objects_by_name(”patch”, case_sensitive=False)

# Mid-string wildcard: names like “Sub_1”, “Sub_gnd_1”. >>> objs = modeler.get_objects_by_name(“Sub*_1”)