get_attr#
- ensobjlist.get_attr(attr: Any, default: Any | None = None)#
Query a specific attribute for all ENSOBJ objects in the list
Walk the items in this object. If they are ENSOBJ subclasses, query the value of the passed attribute id. If the item is not an ENSOBJ subclass or the attribute query fails, the returned list will have the specified default value for that item.
- Parameters:
- attr: Any
The specific attribute (id or string) to look up using getattr().
- default: Any, optional
The value to return for objects that are not ENSOBJ subclasses or do not support the specified attribute.
- Returns:
List
A list of the attribute values for each item in this object
Examples
>>> state = session.ensight.core.PARTS.get_attr(session.ensight.objs.enums.VISIBLE)