MCPcopy
hub / github.com/CadQuery/cadquery / _getTagged

Method _getTagged

cadquery/cq.py:420–433  ·  view source on GitHub ↗

Search the parent chain for an object with tag == name. :param name: the tag to search for :returns: the Workplane object with tag == name :raises: ValueError if no object tagged name

(self: T, name: str)

Source from the content-addressed store, hash-verified

418 return self.objects[0] if self.objects else self.plane.origin
419
420 def _getTagged(self: T, name: str) -> T:
421 """
422 Search the parent chain for an object with tag == name.
423
424 :param name: the tag to search for
425 :returns: the Workplane object with tag == name
426 :raises: ValueError if no object tagged name
427 """
428 rv = self.ctx.tags.get(name)
429
430 if rv is None:
431 raise ValueError(f"No Workplane object named {name} in chain")
432
433 return cast(T, rv)
434
435 def _mergeTags(self: T, obj: "Workplane") -> T:
436 """

Callers 6

workplaneFromTaggedMethod · 0.95
_selectObjectsMethod · 0.95
ancestorsMethod · 0.95
siblingsMethod · 0.95
_queryMethod · 0.80
testTagMethod · 0.80

Calls

no outgoing calls

Tested by 1

testTagMethod · 0.64