sch_replicate_component
Copy a placed schematic component while keeping its master UniqueId so multi-part package units group correctly in ECO; optionally set part ID, placement, and new designator.
Instructions
Copy a placed schematic part and share the master's UniqueId.
ECO groups multi-part packages (quad comparators, dual op-amps) only when every unit has the same UniqueId. Writing UniqueId after the copy is already on the sheet remints a new id if that value is already present. This path stamps UniqueId on the replica before AddSchObject, which is the share that sticks.
Finds the first instance whose designator matches, Replicates it, optionally switches CurrentPartID, optionally moves it, and keeps the master's UniqueId.
Args: designator: Source instance to copy (e.g. "U8"). part_id: 1-based CurrentPartID for the copy. 0 = keep source. x, y: Placement in mils. Omit both to leave the replica where Replicate dropped it. new_designator: Designator for the copy. Empty keeps the source designator (required for multi-part packing).
Returns:
Dict with success, source/copy UniqueIds, part_id, and
shared (true when the copy kept the master's UniqueId).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| part_id | No | ||
| designator | Yes | ||
| new_designator | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||