Return the nth parent of this CQ element :param n: number of ancestor to return (default: 1) :rtype: a CQ object :raises: ValueError if there are no more parents in the chain. For example:: CQ(obj).faces("+Z").vertices().end() will ret
(self, n: int = 1)
| 667 | return self.newObject([self.objects[-1]]) |
| 668 | |
| 669 | def end(self, n: int = 1) -> "Workplane": |
| 670 | """ |
| 671 | Return the nth parent of this CQ element |
| 672 | |
| 673 | :param n: number of ancestor to return (default: 1) |
| 674 | :rtype: a CQ object |
| 675 | :raises: ValueError if there are no more parents in the chain. |
| 676 | |
| 677 | For example:: |
| 678 | |
| 679 | CQ(obj).faces("+Z").vertices().end() |
| 680 | |
| 681 | will return the same as:: |
| 682 | |
| 683 | CQ(obj).faces("+Z") |
| 684 | """ |
| 685 | |
| 686 | rv = self |
| 687 | for _ in range(n): |
| 688 | if rv.parent: |
| 689 | rv = rv.parent |
| 690 | else: |
| 691 | raise ValueError("Cannot End the chain-- no parents!") |
| 692 | |
| 693 | return rv |
| 694 | |
| 695 | def _findType(self, types, searchStack=True, searchParents=True): |
| 696 |
no outgoing calls