getattrs#
- ENS_SCENE.getattrs(attrid: list | None = None, text: int = 0) dict #
Query the value of a collection of attributes
This method queries a collection of attributes in a single call and returns the attribute values in a dictionary keyed by the attribute ids.
- Parameters:
- attrid
Optional
[list
] If this value is a list (of attribute ids as strings or enum values), then the returned dictionary will only include values for the specified attributes. Otherwise, the returned dictionary will include values for all attributes of the target object.
- text
int
By default, the returned dictionary keys are the attribute ID enum values. If text is set to 1, the dictionary keys will be strings. Return:
- attrid
- Returns:
Session
CMD.
Examples
To copy some attributes from one part to another.
>>> tmp = part0.getattrs(["VISIBLE", session.ensight.objs.enums.OPAQUENESS]) >>> part1.setattrs(tmp)