Create a PCB library from scratch and author a real 0603 resistor footprint.
This example does not clone an existing PcbLib. It creates a new footprint, adds pads, silkscreen/fabrication tracks, a component body, and embeds a STEP model from a standalone file on disk.
The model checksum is computed by AltiumPcbLib.add_embedded_model(...).
AltiumPcbFootprint.add_embedded_3d_model(...) infers the STEP projection
bounds and height through wn-geometer. If STEP bounds are unavailable on the
current host, footprint authoring can fall back to a rectangle around the
footprint pads.
AltiumPcbLib()AltiumPcbLib.add_embedded_model(...)AltiumPcbLib.add_footprint(...)AltiumPcbFootprint.set_footprint_primitive_parameter(...)AltiumPcbFootprint.add_pad(...)AltiumPcbFootprint.add_track(...)AltiumPcbFootprint.add_embedded_3d_model(...)AltiumPcbLib.save(...)
From the repository root:
uv run python examples\hello_pcblib\hello_pcblib.pyThe script writes:
examples/hello_pcblib/output/hello_pcblib.PcbLib