get_objects_by_name#
- Modeler2D.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*inassignment:- Parameters:
- Returns:
listofansys.aedt.core.modeler.cad.object_3d.Object3dObjects 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”)