Load a generic two-pin resistor symbol from an existing schematic library, place several resistor components into a blank schematic, and inject the parameters and footprint assignments that would normally be resolved by a database-backed library flow.
This example shows the canonical public path for DBLib-style placement:
- load a generic source symbol from
R_2P.Schlib - load a blank schematic with
AltiumSchDoc(...) - place each resistor with
AltiumSchDoc.add_component_from_library(...) - add resolved value, manufacturer, part-number, and sourcing parameters
- add the resolved PCB footprint implementation
- create a
.PrjPcbthat includes the generated.SchDocand.PcbLib - persist the schematic with
AltiumSchDoc.save(...)
- reusing one generic
R_2Presistor symbol for multiple components - keeping DB-resolved symbol, footprint model, and footprint library names in the application row data
- passing schematic placement coordinates separately from DB row data
- placing components from a
.Schlibfile with public mil coordinates - adding DB-resolved component parameters after placement
- using
Descriptionto populate the component description field - adding a PCB footprint implementation through the placed component API
- keeping resistor pin hotspots on the 100 mil schematic grid
- using Arial 12 bold designators with
=Valuecomments - creating a project with
AltiumPrjPcbBuilder.add_schdoc(...)andAltiumPrjPcbBuilder.add_pcblib(...)
From the project root:
uv run python examples\schdoc_insert_dblib_style\schdoc_insert_dblib_style.pyThis sample uses:
examples/assets/schdoc/blank.SchDoc
examples/assets/schlib/R_2P.Schlib
examples/assets/pcblib/R0603_0.55MM_MD.PcbLib
The script writes:
examples/schdoc_insert_dblib_style/output/schdoc_insert_dblib_style.SchDoc
examples/schdoc_insert_dblib_style/output/R0603_0.55MM_MD.PcbLib
examples/schdoc_insert_dblib_style/output/schdoc_insert_dblib_style.PrjPcb
The output schematic should contain three side-by-side R_2P resistor
placements. Each placement uses the same generic resistor symbol, has DB-style
resolved parameters such as Value, Manufacturer, and Manufacturer Part Number, and references the R0603_0.55MM_MD footprint implementation.
Pin hotspots remain on the 100 mil schematic grid. Designators use Arial 12
bold, and the visible comment field is =Value, so Altium displays the resolved
values such as 10kΩ.