Environment
- KiCad: 9.0.5 (Windows)
- ReplicateLayout: 4.0.3 (installed via PCM)
Steps to reproduce
- Have a project with a repeated hierarchical sheet (multiple instances of the same sheet file).
- Place and route the “source” sheet instance.
- Ensure the destination sheet instance footprints are in a group, e.g.:
- Run ReplicateLayout once with “Group layouts” enabled (so it groups the destination), OR
- Manually group destination footprints in PCB Editor (select → Ctrl+G).
- Run ReplicateLayout again targeting that destination instance.
Actual result
- Plugin errors with something like:
“Destination footprint ... is a member of a different group (... PCB_GROUP ...). All destination footprints have to be members of destination group (...) or no group at all.”
Expected result
- If a destination footprint is already in the correct destination group, ReplicateLayout should not error.
- If “Group layouts” is disabled, destination footprints being grouped should not block replication.
Root cause
- In
replicate_layout.py the code compares a pcbnew.PCB_GROUP object from GetParentGroup() to a string group name.
This makes the “different group” condition true for any footprint that is in any group (including the correct one).
- Similar object-vs-string mismatch exists when adding destination footprints to the destination group.
Proposed fix
- Compare via
fp_group.GetName() (and handle None) instead of comparing the object to a string.
- Only enforce destination grouping rules when
group_layouts is enabled.
- Optionally reuse existing “Replicated Group …” groups instead of erroring if they already exist (useful for reruns/updates).
Proposed Fixed with ChatGPT 5.2
Environment
Steps to reproduce
Actual result
“Destination footprint ... is a member of a different group (... PCB_GROUP ...). All destination footprints have to be members of destination group (...) or no group at all.”
Expected result
Root cause
replicate_layout.pythe code compares apcbnew.PCB_GROUPobject fromGetParentGroup()to a string group name.This makes the “different group” condition true for any footprint that is in any group (including the correct one).
Proposed fix
fp_group.GetName()(and handleNone) instead of comparing the object to a string.group_layoutsis enabled.Proposed Fixed with ChatGPT 5.2