Return rId key of relationship of `reltype` to `target`. The returned `rId` is from an existing relationship if there is one, otherwise a new relationship is created.
(self, target: Part | str, reltype: str, is_external: bool = False)
| 124 | return self.rels.part_with_reltype(reltype) |
| 125 | |
| 126 | def relate_to(self, target: Part | str, reltype: str, is_external: bool = False) -> str: |
| 127 | """Return rId key of relationship of `reltype` to `target`. |
| 128 | |
| 129 | The returned `rId` is from an existing relationship if there is one, otherwise a |
| 130 | new relationship is created. |
| 131 | """ |
| 132 | if is_external: |
| 133 | return self.rels.get_or_add_ext_rel(reltype, cast(str, target)) |
| 134 | else: |
| 135 | rel = self.rels.get_or_add(reltype, cast(Part, target)) |
| 136 | return rel.rId |
| 137 | |
| 138 | @property |
| 139 | def related_parts(self): |