select_objects method

select_objects

Select multiple objects under current node using XPath-like query syntax.

Returns

def select_objects(self, path):
    ...
ParameterTypeDescription
pathstr

Exceptions

ExceptionDescription
ParseExceptionParseException will be thrown if the path contains malformed query.

Example

Select a single node using XPath-like expression

from aspose.threed import Scene
from aspose.threed.entities import Camera, Light

# Create a scene for testing
s = Scene()
a = s.root_node.create_child_node("a")
a.create_child_node("a1")
a.create_child_node("a2")
s.root_node.create_child_node("b")
c = s.root_node.create_child_node("c")
c.create_child_node("c1").add_entity(Camera("cam"))
c.create_child_node("c2").add_entity(Light("light"))
# select objects that has type Camera or name is 'light' whatever it's located.
objects = s.root_node.select_objects("//*[(@Type = 'Camera') or (@Name = 'light')]")

See Also