sch_set_component_part_id
Sets the active sub-part (gate) for a multi-part schematic component; uses location to disambiguate shared designators and refuses ambiguous matches.
Instructions
Switch the active sub-part on a multi-part schematic component.
Multi-gate parts like quad op-amps expose one sub-part per gate (U1A, U1B, U1C, U1D). CurrentPartID selects which one this symbol instance represents. IDs are 1-based.
A DESIGNATOR IS NOT UNIQUE HERE. Every sub-part of a multi-part device carries the same one, so "U13" can name three symbols on the sheet. When it names more than one and no location is given this REFUSES, and returns the candidates with their locations, current part ids and unique ids. It used to write whichever the iterator reached first and report success naming only the designator, so the caller could not tell which symbol changed.
Location is the discriminator because the alternatives do not work: two symbols can sit on the same part, and sub-parts of one physical device are supposed to SHARE a unique id.
Args: designator: Component reference (e.g., "U1"). part_id: Sub-part index, 1-based (1=A, 2=B, ...). A value above PartCount is accepted by Altium and does not take, so the result is read back and a mismatch is reported. location_x: Symbol X in mils, to choose one of several. location_y: Symbol Y in mils, to choose one of several.
Returns:
Dict with success, designator, part_id, the location written
and how many symbols carried the designator. On ambiguity,
an AMBIGUOUS_DESIGNATOR error carrying candidates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| part_id | Yes | ||
| designator | Yes | ||
| location_x | No | ||
| location_y | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||