Select the object(s) with the Nth length Applicability: All Edge and Wire objects
| 453 | |
| 454 | |
| 455 | class LengthNthSelector(_NthSelector): |
| 456 | """ |
| 457 | Select the object(s) with the Nth length |
| 458 | |
| 459 | Applicability: |
| 460 | All Edge and Wire objects |
| 461 | """ |
| 462 | |
| 463 | def key(self, obj: Shape) -> float: |
| 464 | if obj.ShapeType() in ("Edge", "Wire"): |
| 465 | return cast(Shape1DProtocol, obj).Length() |
| 466 | else: |
| 467 | raise ValueError( |
| 468 | f"LengthNthSelector supports only Edges and Wires, not {type(obj).__name__}" |
| 469 | ) |
| 470 | |
| 471 | |
| 472 | class AreaNthSelector(_NthSelector): |
no outgoing calls