Closed bug report

xcopy_footprint: a copy within one library lands off the origin (whole footprint translated)

Colby Knox · ·closed by Colby Knox

altium-bridge 0.2.83 (and the head source) · Altium Designer Develop · Windows 11 · DESKTOP-BAR6S0F

What happened

altium_xcopy_footprint copying a footprint into the same library puts the copy off its origin. The battery does exactly this (xcopy_footprint: BAT_FP to BAT_FP_X in Battery.PcbLib). Its entry accepts any answer, so the battery never noticed. The new altium_lint_library found it (origin_off_part).

Source BAT_FP, read with altium_read_footprint: pad 1 (-1.016, 0), pad 2 (1.016, 0), pad 99 (5, 5).

The copy BAT_FP_X:

build pad 1 pad 2 pad 99
0.2.83 as published (battery copy) (-1271.016, -1270) (-1268.984, -1270) not copied? (2 pads read)
head source, copy redone 2026-10-30 (5, 5) (7.032, 5) (11.016, 10)

The shape survives; the whole copy is translated. In the second row the translation is (6.016, 5), which is pad 99 minus pad 1 of the source. show_footprint on the copy shows the origin marker with no pads near it.

Tried, no change (reverted)

  1. Measuring the source pad while the source is on display, before the copy is made current (the shift block sets both current first and then measures).
  2. Taking the source from the open library, not from LoadPCBLibraryByPath, when fromLib is the destination.
  3. ViewManager_FullUpdate after each CurrentComponent switch.

The arithmetic in the shift block cannot by itself produce a shift of pad 99 minus pad 1. Next things to look at: whether FpPad / FirstPadName answer the pad they claim to, and whether RegisterComponent or PostProcess moves the primitives after the shift.

To reproduce

altium_remove_footprint {"libraryPath": ".../Battery.PcbLib", "footprintName": "BAT_FP_X"}
altium_xcopy_footprint {"fromLib": ".../Battery.PcbLib", "toLib": ".../Battery.PcbLib", "from": "BAT_FP", "to": "BAT_FP_X"}
altium_read_footprint {"libraryPath": ".../Battery.PcbLib", "name": "BAT_FP_X"}
altium_lint_library {"libraryPath": ".../Battery.PcbLib", "names": ["BAT_FP_X"]}

The battery entry should check the copy's pad 1 lands where the source's does, once this is fixed.

1 Reply

Colby Knox ·

Fixed in 0.2.85 (insiders). The copy measured its source after the copy had taken the display, when Altium reports a footprint's primitives without the library's origin, so it landed one origin (50,000 mil, 1270 mm) off. Moving it after it was shown did not hold either. The replicas are now taken from the source while it is on display and made relative to the origin, and the copy checks itself once shown (copy_misplaced names the pad). Measured: BAT_FP copied within Battery.PcbLib and E-8 copied from the SpiritLevel example library both match their source pad for pad across repeated reads. The battery now copies, then lints the copy for origin_off_part; full Develop and AD26 batteries are clean (262/263, 1 safety skip).

Colby Knox closed this ·

Log in to reply.