Multi-Board Net Classes
Net classes live on the container .kicad_pro and replicate physically into every sub-project. The API mirrors the desktop Schematic Setup → Net Classes panel.
get_netclass_report()
Returns the replication state across container + sub-projects.
mbs = kicad.get_mbs_schematic()
report = mbs.multi_board.get_netclass_report()
# Container classes — each is the source of truth
for nc in report.container_classes:
print(f"{nc.fields.name}: {nc.status}")
# Per-sub-project state
for sub in report.sub_projects:
print(f"\n{sub.name} (loaded={sub.loaded}):")
for nc in sub.classes:
print(f" {nc.fields.name} — {nc.status}") # SHARED / LOCAL / CONFLICT
status semantics match the desktop Status column:
SHARED: sub-project's copy matches the containerLOCAL: sub-project has its own overrideCONFLICT: copy diverges from container
loaded=False means the sub-project was opened transiently from disk to read its tables; read_error is set when the disk read failed.
set_netclass(name, **fields)
Create or update a net class on the container. Loaded sub-projects pick up the change immediately.
mbs.multi_board.set_netclass(
"HighSpeed",
clearance_iu=200_000,
track_width_iu=200_000,
via_diameter_iu=600_000,
via_drill_iu=300_000,
diff_pair_width_iu=200_000,
diff_pair_gap_iu=150_000,
)
Use name="Default" to update the default class (it always exists and cannot be created or deleted).
All numeric fields use IU (internal units), matching get_netclass_report output. Omitted fields are cleared on the resulting class (the panel's "leave empty → use container default" semantic).
String fields: tuning_profile, pcb_color_css, schematic_color_css.
Returns counters: created, propagator_ran, sub_projects_touched, classes_added, classes_unchanged, classes_overwritten, classes_kept, classes_skipped.
delete_netclass(name)
Remove a net class from the container.
mbs.multi_board.delete_netclass("HighSpeed")
Sub-projects keep their own copy. Deletion does not propagate (matches desktop behavior). Idempotent: returns deleted=False when the class wasn't present. The Default class cannot be deleted.