Board¶
- class Board(kicad: KiCadClient, document: DocumentSpecifier)¶
Represents an open board (.kicad_pcb) document in KiCad
- add_embedded_files(files: EmbeddedFile | Sequence[EmbeddedFile])¶
Appends the given file(s) to the board’s embedded files
Added in version 0.9.0: (KiCad 10.0.7)
- check_padstack_presence_on_layers(items: BoardItem | Iterable[BoardItem], layers: int | Iterable[int]) dict[BoardItem, dict[int, bool]]¶
Checks if the given items with padstacks (pads or vias) have content on the given layers.
- Parameters:
items – The items to check (one or more pads or vias).
layers – The layer or layers to check for padstack presence.
- Returns:
A dictionary mapping each item to a dictionary of layers and their presence on the given layer.
Added in version 0.4.0: with KiCad 9.0.3
- property client: KiCadClient¶
The KiCad client used to communicate with the API server
- property document: DocumentSpecifier¶
The document specifier for the board
- expand_text_variables(text: str, *, expand_env_vars: bool = False) str¶
- expand_text_variables(text: list[str], *, expand_env_vars: bool = False) list[str]
Expands text variables in a string or list of strings. Any text variables that do not exist will be left as-is in the output.
- Parameters:
expand_env_vars – will expand environment variables in addition to built-in KiCad text variables when True.
- export_3d(output_path: str, settings: Export3DSettings | None = None) JobResult¶
Exports the board as a 3D model file.
- export_drill(output_path: str, format: int = 1, origin: int = 0, map_format: int = 0, report_filename: str = '', precision: int = 0, generate_tenting: bool = False, units: int = 0, zeros_format: int = 0, route_oval_holes: bool = False, combine_pth_npth: bool = True, minimal_header: bool = False, mirror_y: bool = False) JobResult¶
Exports NC drill files from the board.
- export_drill_excellon(output_path: str, origin: int = 0, map_format: int = 0, report_filename: str = '', units: int = 0, zeros_format: int = 0, route_oval_holes: bool = False, combine_pth_npth: bool = True, minimal_header: bool = False, mirror_y: bool = False) JobResult¶
Exports excellon NC drill files from the board.
- export_drill_gerber(output_path: str, origin: int = 0, map_format: int = 0, report_filename: str = '', precision: int = 0, generate_tenting: bool = False) JobResult¶
Exports gerber NC drill files from the board.
- export_dxf(output_path: str, plot_settings: PlotSettings | None = None, plot_graphic_items_using_contours: bool = False, polygon_mode: bool = False, units: int = 2, page_mode: int = 1) JobResult¶
Exports the board to DXF.
- export_gencad(output_path: str, flip_bottom_pads: bool = False, use_individual_shapes: bool = False, store_origin_coords: bool = False, use_drill_origin: bool = False, use_unique_pins: bool = False) JobResult¶
Exports the board to GenCAD format.
- export_gerbers(output_path: str, plot_settings: PlotSettings | None = None, use_board_plot_params: bool = False, create_gerber_job_file: bool = False, include_netlist_attributes: bool = True, use_x2_format: bool = True, disable_aperture_macros: bool = False, use_protel_file_extensions: bool = True, precision: int = 1) JobResult¶
Plots the board to Gerber files.
- export_ipc2581(output_path: str, settings: Ipc2581ExportSettings | None = None) JobResult¶
Exports the board to IPC-2581 format.
- export_odb(output_path: str, drawing_sheet: str = '', variant: str = '', units: int = 2, precision: int = 6, compression: int = 2) JobResult¶
Exports the board to ODB++ format.
- export_pdf(output_path: str, plot_settings: PlotSettings | None = None, include_metadata: bool = True, single_document: bool = True, page_mode: int = 1, background_color: str = '', front_footprint_property_popups: bool = False, back_footprint_property_popups: bool = False) JobResult¶
Plots the board to PDF.
- export_png(output_path: str, plot_settings: PlotSettings | None = None, dpi: int | None = None, antialiasing: int = 0, page_mode: int = 1) JobResult¶
Plots the board to PNG.
- Parameters:
output_path – Sets the directory or filename of the export
plot_settings – Controls the general shared schematic plot settings
dpi – Sets the resolution of the generated image. When omitted, the default of 300 is used. KiCad accepts between 72 and 2400 DPI.
antialiasing – Controls whether the output image is anti-aliased (enabled by default)
page_mode – Set to
BJPM_ALL_LAYERS_ONE_PAGE,output_pathis taken as a filename and one file is created. Otherwise, the board layers inPlotSettingsare each plotted to a file in the directory given byoutput_path.
- export_position(output_path: str, settings: PositionExportSettings | None = None) JobResult¶
Exports pick-and-place position files from the board.
- export_ps(output_path: str, plot_settings: PlotSettings | None = None, page_mode: int = 1, track_width_correction: float = 0.0, x_scale_adjust: float = 1.0, y_scale_adjust: float = 1.0, force_a4: bool = False, use_global_settings: bool = False) JobResult¶
Plots the board to PostScript.
- export_render(output_path: str, settings: RenderSettings | None = None) JobResult¶
Exports a raytraced 3D render of the board.
- export_stats(output_path: str, format: int = 1, units: int = 2, exclude_footprints_without_pads: bool = False, subtract_holes_from_board_area: bool = False, subtract_holes_from_copper_areas: bool = False) JobResult¶
Exports board statistics.
- export_svg(output_path: str, plot_settings: PlotSettings | None = None, fit_page_to_board: bool = False, precision: int = 4, page_mode: int = 1) JobResult¶
Plots the board to SVG.
- flip_items(items: BoardItem | Sequence[BoardItem], direction: int = 1) list[BoardItem]¶
Flips one or more board items to the opposite side of the board.
The given items must already exist on the board; each is flipped in place and the Python item passed in is updated with the new state from KiCad. Returns the set of items that were successfully flipped.
- Parameters:
items – one or more board items to flip
direction –
BFD_LEFT_RIGHT(mirror around the Y axis) orBFD_TOP_BOTTOM(mirror around the X axis)
Added in version 0.8.0: (KiCad 10.0.6)
- flip_items_by_id(items: KIID | Sequence[KIID], direction: int = 1) list[BoardItem]¶
Flips one or more board items to the opposite side of the board by their unique IDs.
Returns the flipped items as returned by KiCad. Items that could not be flipped (for example because the ID doesn’t exist or the type is not a flippable board item) will be omitted.
- Parameters:
items – one or more item IDs (KIID) to flip
direction –
BFD_LEFT_RIGHT(mirror around the Y axis) orBFD_TOP_BOTTOM(mirror around the X axis)
Added in version 0.8.0: (KiCad 10.0.6)
- get_active_layer() int¶
- get_barcodes() Sequence[Barcode]¶
Retrieves all barcode objects on the board
Added in version 0.7.0.
- get_connected_items(items: BoardItem | KIID | Sequence[BoardItem | KIID], types: int | Sequence[int] | None = None) Sequence[Item]¶
Retrieves items that are copper-connected to the given source item(s) or item IDs
Added in version 0.7.0: (KiCad 10.0.1)
- get_constraints() Sequence[Constraint]¶
Retrieves all constraint objects on the board.
Added in version 0.x.0: (KiCad 11)
- get_copper_layer_count() int¶
- Returns:
The number of copper layers on the current board
Added in version 0.5.0: (with KiCad 9.0.5)
- get_custom_design_rules() CustomRulesResponse¶
Retrieves custom design rules and parse status / any error messages.
Added in version 0.7.0: (with KiCad 11)
- get_design_rules() BoardDesignRulesResponse¶
Retrieves the board design rules (not including custom rules).
Added in version 0.7.0: (with KiCad 11)
- get_editor_appearance_settings() BoardEditorAppearanceSettings¶
- get_embedded_files() EmbeddedFiles¶
Retrieves the files embedded in the board
Added in version 0.9.0: (KiCad 10.0.7)
- get_enabled_layers() list[int]¶
Retrieves the list of all enabled layers in the board, including copper and non-copper layers.
- Returns:
A list of enabled BoardLayer enums.
Added in version 0.5.0: (with KiCad 9.0.5)
- get_footprints() Sequence[FootprintInstance]¶
Retrieves all footprints on the board
- get_graphics_defaults() dict[int, BoardLayerGraphicsDefaults]¶
Retrieves the default graphics properties for each layer class on the board
- get_grid_items() Sequence[GridItem]¶
Retrieves all grid items on the board.
Added in version 0.x.0: (KiCad 11)
- get_groups() Sequence[Group]¶
Retrieves all groups on the board
Added in version 0.7.0: (KiCad 10.0.0)
- get_item_bounding_box(items: BoardItem, include_text: bool = False) Box2 | None¶
- get_item_bounding_box(items: Sequence[BoardItem], include_text: bool = False) list[Box2 | None]
Gets the KiCad-calculated bounding box for an item or items, returning None if the item does not exist or has no bounding box
- get_items(types: int | Sequence[int] | None = None) Sequence[BoardItem]¶
Retrieves items from the board, optionally filtering to a single or set of types
Providing no
typesfilter will result in all valid types for the given document being retrieved on KiCad 10.0.7 and newer, and is an error on older versions.
- get_items_by_id(ids: KIID | Sequence[KIID]) Sequence[BoardItem]¶
Retrieves items from the board by their KIID (internal unique identifier)
Added in version 0.7.0: (KiCad 10.0.0)
- get_items_by_net(nets: Net | Sequence[Net], types: int | Sequence[int] | None = None) Sequence[Item]¶
Retrieves items from the board, filtered by one or more nets
Added in version 0.7.0: (KiCad 10.0.1)
- get_items_by_netclass(net_classes: str | Sequence[str], types: int | Sequence[int] | None = None) Sequence[Item]¶
Retrieves items from the board, filtered by one or more net class names
Added in version 0.7.0: (KiCad 10.0.1)
- get_layer_by_name(layer_name: str) int¶
Retrieves a board layer ID from the given name, which may be either a KiCad standard layer name (e.g.
In1.Cu) or a user-defined name in the current board. ReturnsBL_UNDEFINEDif the given name doesn’t map to any layer in the current board.Added in version 0.8.0: (KiCad 10.0.6)
- get_layer_name(layer: int) str¶
Retrieves the user-visible name of a given layer, which may be a default value like “F.Cu” or may have been customized by the user. This method does not apply to dielectric layers.
Added in version 0.6.0: (KiCad 9.0.8)
- get_netclass_for_nets(nets: Net | Sequence[Net]) dict[str, NetClass]¶
Retrieves the net class for one or more nets on the board
- get_nets(netclass_filter: str | Sequence[str] | None = None) Sequence[Net]¶
Retrieves all nets on the board, optionally filtering by net class
- get_origin(origin_type: int) Vector2¶
Retrieves the specified (grid or drill/place) board origin
Added in version 0.3.0.
- get_pad_shapes_as_polygons(pads: Pad, layer: int = BoardLayer.BL_F_Cu) PolygonWithHoles | None¶
- get_pad_shapes_as_polygons(pads: Sequence[Pad], layer: int = BoardLayer.BL_F_Cu) list[PolygonWithHoles | None]
Retrieves the polygonal shape of one or more pads on a given layer. If a pad does not exist or has no polygonal shape on the given layer, None will be returned for that pad.
- get_pads() Sequence[Pad]¶
Retrieves all pads on the board (note that pads belong to footprints, not the board itself)
- get_plot_settings() PlotSettings¶
Retrieves the board plot settings stored in the board file.
Added in version 0.x.0.
- get_reference_images() Sequence[ReferenceImage]¶
Retrieves all reference image objects on the board
Added in version 0.7.0.
- get_reference_points() Sequence[ReferencePoint]¶
Retrieves all reference point objects on the board
Added in version 0.9.0: (KiCad 10.0.7)
- get_selection(types: int | Sequence[int] | None = None) Sequence[BoardItem]¶
Retrieves the items in the current selection, optionally filtering by type
- get_shapes() Sequence[BoardShape]¶
Retrieves all graphic shapes (not including tracks or text) on the board
- get_stackup() BoardStackup¶
Retrieves the stackup for the board
- get_tables() Sequence[Table]¶
Retrieves all table objects on the board
Added in version 0.9.0: (KiCad 10.0.7)
- get_text() Sequence[BoardText | BoardTextBox]¶
Retrieves all text objects on the board
- get_title_block_info() TitleBlockInfo¶
Retrieves the title block information for the board
- get_visible_layers() Sequence[int]¶
- get_zones() Sequence[Zone]¶
Retrieves all zones (including rule areas and graphic zones) on the board
- hit_test(item: Item, position: Vector2, tolerance: int = 0) bool¶
Performs a hit test on a board item at a given position
- import_netlist(netlist_path: str, dry_run: bool = False, match_mode: int = 1, delete_extra_footprints: bool = True, update_footprints: bool = True, transfer_groups: bool = True, override_locks: bool = False) ImportNetlistResult¶
Imports a netlist exported from the schematic and updates the board.
- interactive_move(items: KIID | Iterable[KIID])¶
Initiates an interactive move operation on one or more items on the board. The user will be able to move the items interactively in the KiCad editor. This is a blocking operation; this function will return immediately but future API calls will return
AS_BUSYuntil the interactive move is complete.
- property name: str¶
Returns the file name of the board
- place_footprint_from_library(lib_id: LibraryIdentifier | str, position: Vector2, orientation: Angle | None = None, layer: int = 3) FootprintInstance¶
Places a footprint from a library onto the board.
Requires that libraries be loaded, which will not be the case in headless mode until
load_all_libraries()has been called.- Parameters:
lib_id – The footprint to place, either as a
LibraryIdentifieror a string such as"Resistor_SMD:R_0603_1608Metric".position – The position to place the footprint at.
orientation – Optional orientation; 0 degrees if not given.
layer – The copper layer to place the footprint on. Must be
BL_F_CuorBL_B_Cu; the footprint is flipped when placed onBL_B_Cu.
- Returns:
The newly-placed footprint instance.
Added in version 0.x.y: (KiCad 11)
- refill_zones(zones: KIID | Iterable[KIID] | None = None, block=True, max_poll_seconds: float = 30.0, poll_interval_seconds: float = 0.5)¶
Refills all zones on the board. If block is True, this function will block until the refill operation is complete. If block is False, this function will return immediately, and future API calls will return
AS_BUSYuntil the refill operation is complete.- Parameters:
zones – An optional list of zone IDs to fill. If empty or absent, all zones will be filled (Since: 0.x.0 / KiCad 11.0)
block – When True (default), this call will block until the zone fill completes (which could take many seconds or even minutes in some cases). When False, this call will return immediately, but the KiCad API server will not handle any more requests until the zone fill has been completed.
max_poll_seconds – How long to wait (when block is True) for the zone fill to finish.
poll_interval_seconds – How often to check (when block is True) for the fill to have finished.
- set_active_layer(layer: int)¶
- set_custom_design_rules(rules: CustomRule | Sequence[CustomRule]) CustomRulesResponse¶
Sets custom design rules.
Added in version 0.7.0: (with KiCad 11)
- set_design_rules(rules: BoardDesignRules) BoardDesignRulesResponse¶
Sets the board design rules.
Added in version 0.7.0: (with KiCad 11)
- set_editor_appearance_settings(settings: BoardEditorAppearanceSettings)¶
- set_embedded_files(files: EmbeddedFile | Sequence[EmbeddedFile])¶
Replaces all files embedded in the board with the given file(s)
Added in version 0.9.0: (KiCad 10.0.7)
- set_enabled_layers(copper_layer_count: int, layers: Sequence[int]) list[int]¶
Sets the copper layer count and enabled non-copper layers for the board.
WARNING: Any existing content on layers that are removed by this call is deleted. This operation cannot be undone.
- Parameters:
copper_layer_count – The number of copper layers to enable (must be even and >= 2).
layers – The non-copper layers to enable.
- Returns:
The updated list of enabled BoardLayer enums.
Added in version 0.5.0: (with KiCad 9.0.5)
- set_origin(origin_type: int, origin: Vector2)¶
Sets the specified (grid or drill/place) board origin
Added in version 0.3.0.
- set_plot_settings(plot_settings: PlotSettings)¶
Sets the board plot settings stored in the board file.
Added in version 0.x.0.
- set_title_block_info(title_block: TitleBlockInfo)¶
Sets the title block information for the board
Added in version 0.7.0: (with KiCad 10.0.1)
- set_visible_layers(layers: Sequence[int])¶
- class BoardEdgeConnector(proto: BoardEdgeConnector | None = None)¶
The type of edge connector present on the board
Added in version 0.8.0: (KiCad 10.0.6)
- property type: int¶
- class BoardEdgeSettings(proto: BoardEdgeSettings | None = None)¶
Settings related to board edges, such as connectors and plating
Added in version 0.8.0: (KiCad 10.0.6)
- property connector: BoardEdgeConnector¶
- property plating: EdgePlating¶
- class BoardFinish(proto: BoardFinish | None = None)¶
The board finish (e.g. ENIG, HASL, OSP) applied to exposed copper
Added in version 0.8.0: (KiCad 10.0.6)
- property type_name: str¶
The finish type name
- class BoardImpedanceControl(proto: BoardImpedanceControl | None = None)¶
Whether impedance-controlled routing is enabled for this board
Added in version 0.8.0: (KiCad 10.0.6)
- property is_controlled: bool¶
True if the board uses impedance-controlled widths
- class BoardLayerGraphicsDefaults(proto: BoardLayerGraphicsDefaults | None = None)¶
The default properties for graphic items added on a given class of board layer
- property layer: int¶
The layer class that these defaults apply to
- property line_thickness: int¶
- property text: TextAttributes¶
- class BoardStackup(proto: BoardStackup | None = None)¶
- property edge: BoardEdgeSettings¶
Edge connector and plating settings
Added in version 0.8.0.
- property finish: BoardFinish¶
The board finish (e.g. ENIG, HASL, OSP)
Added in version 0.8.0.
- property impedance: BoardImpedanceControl¶
Whether impedance-controlled routing is enabled
Added in version 0.8.0.
- property layers: list[BoardStackupLayer]¶
The stackup layers, in order from top to bottom of the board
- class BoardStackupDielectricLayer(proto: BoardStackupDielectricLayer | None = None)¶
- property layers: list[BoardStackupDielectricProperties]¶
Each dielectric layer may be made up of one or more sub-layers with different properties
- property type: int¶
The physical type of this dielectric slot (e.g. core or prepreg)
Added in version 0.8.0: (KiCad 10.0.6)
- class BoardStackupDielectricProperties(proto: BoardStackupDielectricProperties | None = None)¶
- property dielectric_model: int¶
The model used to extrapolate dielectric properties across frequency
Added in version 0.8.0: (KiCad 11.0)
- property epsilon_r: float¶
- property loss_tangent: float¶
- property material_name: str¶
- property spec_frequency: float | None¶
The frequency at which the dielectric properties were measured, in Hz
Added in version 0.8.0: (KiCad 11.0)
- property thickness: int¶
- property thickness_locked: bool¶
Whether the layer thickness is locked (for impedance controlled layers)
Added in version 0.8.0: (KiCad 10.0.6)
- class BoardStackupLayer(proto: BoardStackupLayer | None = None)¶
-
- property dielectric: BoardStackupDielectricLayer | None¶
Dielectric details, if this layer is a dielectric layer
Added in version 0.8.0: (KiCad 10.0.6)
- property enabled: bool¶
- property layer: int¶
The board layer this stackup entry corresponds to, or
BL_UNDEFINEDif this entry is a dielectric layer
- property material_name: str¶
- property silkscreen: BoardStackupSilkscreenLayer | None¶
Silkscreen details, if this layer is a silkscreen layer
Added in version 0.8.0: (KiCad 10.0.6)
- property soldermask: BoardStackupSoldermaskLayer | None¶
Soldermask details, if this layer is a soldermask layer
Added in version 0.8.0: (KiCad 10.0.6)
- property thickness: int¶
The total thickness of this layer, in nanometers. If this is a dielectric layer, this thickness may be the sum of multiple sub-layers.
- property type: int¶
- property user_name: str¶
The name of the layer shown in the KiCad GUI, which may be a default value like “F.Cu” or may have been customized by the user. This field does not apply to dielectric layers.
- class BoardStackupSilkscreenLayer(proto: BoardStackupSilkscreenLayer | None = None)¶
Properties of a silkscreen layer
Added in version 0.8.0: (KiCad 10.0.6)
- property material_name: str¶
- class BoardStackupSoldermaskLayer(proto: BoardStackupSoldermaskLayer | None = None)¶
Properties of a soldermask layer
Added in version 0.8.0: (KiCad 10.0.6)
- property epsilon_r: float¶
- property loss_tangent: float¶
- property material_name: str¶
- property thickness: int¶
- class EdgePlating(proto: EdgePlating | None = None)¶
Whether the board edges are plated
Added in version 0.8.0: (KiCad 10.0.6)
- property has_edge_plating: bool¶
True if board edges are plated with copper
- class ImportNetlistResult(proto: ImportNetlistResponse | None = None, proto_ref: ImportNetlistResponse | None = None)¶
Result of importing a schematic netlist into the board.
- property error_count: int¶
- property new_footprint_count: int¶
- property report: str¶
Human-readable report of changes and any warnings or errors.
- property warning_count: int¶
Board Types¶
- class AlignedDimension(proto: Dimension | None = None, proto_ref: Dimension | None = None)¶
-
- property extension_height: int¶
- property height: int¶
- class ArcTrack(proto: Arc | None = None, proto_ref: Arc | None = None)¶
Represents an arc track segment
- angle() float | None¶
Calculates the angle between the start and end of the arc in radians
- Returns:
The angle of the arc, or None if the arc is degenerate
Added in version 0.4.0.
- center() Vector2 | None¶
Calculates the center of the arc. Uses a different algorithm than KiCad so may have slightly different results. The KiCad API preserves the start, middle, and end points of the arc, so any other properties such as the center point and angles must be calculated
- Returns:
The center of the arc, or None if the arc is degenerate
- end_angle() float | None¶
- property layer: int¶
- length() float¶
Calculates arc track length in nanometers
- Returns:
The length of the arc, or the distance between the start and end points if the arc is degenerate
Added in version 0.3.0.
- property locked: bool¶
Added in version 0.6.0.
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- radius() float¶
Calculates the radius of the arc. Uses a different algorithm than KiCad so may have slightly different results. The KiCad API preserves the start, middle, and end points of the arc, so any other properties such as the center point and angles must be calculated
- Returns:
The radius of the arc, or 0 if the arc is degenerate
- property solder_mask: SolderMaskOverrides¶
Solder mask overrides for this arc track
Added in version 0.9.0: (KiCad 10.0.7)
- start_angle() float | None¶
- property width: int¶
- class Barcode(proto: Barcode | None = None, proto_ref: Barcode | None = None)¶
Represents a barcode object
Added in version 0.7.0: (KiCad 10.0.1)
- property error_correction: int¶
- property height: int¶
- property kind: int¶
- property knockout: bool¶
- property layer: int¶
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property show_text: bool¶
- property text: str¶
- property text_height: int¶
- property width: int¶
- class BoardArc(proto: BoardGraphicShape | None = None, proto_ref: BoardGraphicShape | None = None)¶
Represents a graphic arc (not a track) on a board or footprint
- class BoardBezier(proto: BoardGraphicShape | None = None, proto_ref: BoardGraphicShape | None = None)¶
Represents a graphic bezier curve on a board or footprint
- class BoardCircle(proto: BoardGraphicShape | None = None, proto_ref: BoardGraphicShape | None = None)¶
Represents a graphic circle on a board or footprint
- class BoardEditorAppearanceSettings(proto: BoardEditorAppearanceSettings | None = None, proto_ref: BoardEditorAppearanceSettings | None = None)¶
- property board_flip: int¶
Whether or not the board view is flipped (mirrored around the X axis)
- property inactive_layer_display: int¶
How layers other than the active (selected) layer are displayed
- property net_color_display: int¶
Whether to apply net and netclass colors to copper items and ratsnest lines
- property ratsnest_display: int¶
Whether or not ratsnest lines are drawn to hidden layers
- class BoardPolygon(proto: BoardGraphicShape | None = None, proto_ref: BoardGraphicShape | None = None)¶
Represents a graphic polygon on a board or footprint
- classmethod from_rectangle(rectangle: BoardRectangle) Self¶
Converts a BoardRectangle into a BoardPolygon with matching corners.
Other properties of the rectangle, including UUID, are preserved.
- class BoardRectangle(proto: BoardGraphicShape | None = None, proto_ref: BoardGraphicShape | None = None)¶
Represents a graphic rectangle on a board or footprint
- class BoardSegment(proto: BoardGraphicShape | None = None, proto_ref: BoardGraphicShape | None = None)¶
Represents a graphic line segment (not a track) on a board or footprint
- class BoardShape(proto: BoardGraphicShape | None = None, proto_ref: BoardGraphicShape | None = None)¶
Represents a graphic shape on a board or footprint
- property attributes: GraphicAttributes¶
- property id: KIID¶
- property layer: int¶
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property proto¶
Returns the outer BoardGraphicShape proto. Overrides GraphicShape.proto, which would otherwise shadow this via the MRO and return the inner GraphicShape message (the wrong type for the board item wire format).
- property solder_mask: SolderMaskOverrides¶
Solder mask overrides for this shape (only applies to shapes on outer copper layers)
Added in version 0.9.0: (KiCad 10.0.7)
- class BoardText(proto: BoardText | None = None, proto_ref: BoardText | None = None)¶
Represents a free text object, or the text component of a field
- property attributes: TextAttributes¶
- property id: KIID¶
- property layer: int¶
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property value: str¶
- class BoardTextBox(proto: BoardTextBox | None = None, proto_ref: BoardTextBox | None = None)¶
Represents a text box on a board
- property attributes: TextAttributes¶
- property layer: int¶
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property value: str¶
- class CartesianGridItemAttributes(proto: CartesianGridItemAttributes | None = None, proto_ref: CartesianGridItemAttributes | None = None)¶
Added in version 0.x.0: (KiCad 11)
- class CenterDimension(proto: Dimension | None = None, proto_ref: Dimension | None = None)¶
- class Constraint(proto: Constraint | None = None, proto_ref: Constraint | None = None)¶
A geometric constraint between board items
Added in version 0.x.0: (KiCad 11)
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
- property driving: bool¶
- property id: KIID¶
- property members: MutableWrapperSequence[ConstraintMember]¶
- property type: int¶
- property value: float | None¶
- class ConstraintMember(proto: ConstraintMember | None = None, proto_ref: ConstraintMember | None = None)¶
Added in version 0.x.0: (KiCad 11)
- property anchor: int¶
- property index: int | None¶
- property item: KIID¶
- class Dimension(proto: Dimension | None = None, proto_ref: Dimension | None = None)¶
Represents a dimension object on a board
- property arrow_direction: int¶
- property arrow_length: int¶
- property extension_offset: int¶
- property id: KIID¶
- property keep_text_aligned: bool¶
- property layer: int¶
- property line_thickness: int¶
- property locked: bool¶
- property override_text: str¶
- property override_text_enabled: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property precision: int¶
- property prefix: str¶
- property suffix: str¶
- property suppress_trailing_zeroes: bool¶
- property text_position: int¶
- property unit: int¶
- property unit_format: int¶
- class DrillChart(proto: DrillChart | None = None, proto_ref: DrillChart | None = None)¶
A drill chart: a table on the board that lists the drill operations used by the board.
Added in version 0.x.0: (KiCad 11)
- property columns: MutableWrapperSequence[DrillChartColumn]¶
- property filter: DrillChartFilter¶
- property id: KIID¶
- property precision: int¶
- property row_shapes: dict[int, int]¶
Map of row index to drill symbol index
- property show_totals: bool¶
- property symbol_column: int¶
Index of the column that displays drill symbols
- property table: Table¶
The underlying table of the drill chart. Editing the cell contents directly is not supported as they will be regenerated by KiCad.
- property units: int¶
- class DrillChartColumn(proto: DrillChartColumn | None = None, proto_ref: DrillChartColumn | None = None)¶
A column configuration of a drill chart
Added in version 0.x.0: (KiCad 11)
- property align: int¶
- property heading: str¶
- property id: int¶
- property width: int¶
Column width in nanometers
- class DrillChartFilter(proto: DrillChartFilter | None = None, proto_ref: DrillChartFilter | None = None)¶
Which kinds of drill operations a drill chart includes
Added in version 0.x.0: (KiCad 11)
- property backdrills: bool¶
- property castellated: bool¶
- property non_plated: bool¶
- property plated: bool¶
- property slots: bool¶
- property vias: bool¶
- class DrillMap(proto: DrillMap | None = None, proto_ref: DrillMap | None = None)¶
A graphical item that generates drill markers (symbols) at all hole locations
Added in version 0.x.0: (KiCad 11)
- property guide_cross: bool¶
- property id: KIID¶
- property layer: int¶
- property locked: bool¶
- property outline_slots: bool¶
- property position: Vector2¶
Drill map position is a relative offset from the true location of the holes.
A position of (0, 0) means that the drill symbols will be overlaid on the actual hole locations of the board.
- property symbol_size: int¶
Size of the drill symbols in nanometers
- class DrillProperties(proto: DrillProperties | None = None, proto_ref: DrillProperties | None = None)¶
- property capped: int¶
Whether the drill is capped (e.g. for tented back drills)
- property diameter: Vector2¶
The drill diameter, which may also be a milled slot with different X and Y dimensions
- property end_layer: int¶
Highest (closest to B_Cu) layer this drill exists on.
- property filled: int¶
Whether the drill is filled
- property shape: int¶
- property start_layer: int¶
Lowest (closest to F_Cu) layer this drill exists on.
- class DrillSpan(proto: DrillSpan | None = None, proto_ref: DrillSpan | None = None)¶
A span of layers that a drill operation crosses
Added in version 0.x.0: (KiCad 11)
- property end_layer: int¶
- property is_backdrill: bool¶
- property is_non_plated: bool¶
- property start_layer: int¶
- class Field(proto: Field | None = None, proto_ref: Field | None = None)¶
Represents a footprint field
- property field_id: int¶
- property layer: int¶
- property name: str¶
- property visible: bool¶
Added in version 0.3.0: with KiCad 9.0.1
- class Footprint(proto: Footprint | None = None, proto_ref: Footprint | None = None)¶
Represents the definition of a footprint (existing in a footprint library or on a board), which contains the child objects of the footprint (pads, text, etc). Footprint definitions are contained by a FootprintInstance which represents a footprint placed on a board.
- add_item(item: Wrapper)¶
- property anchor: Vector2¶
The anchor (origin) position of the footprint
Added in version 0.9.0: (KiCad 10.0.7)
- property id: LibraryIdentifier¶
- property items: Sequence[Wrapper]¶
- property jumpers: JumperSettings¶
The jumper settings for this footprint
Added in version 0.9.0: (KiCad 10.0.7)
- property models: Sequence[Footprint3DModel]¶
Returns all 3D models in the footprint
Added in version 0.3.0.
- property net_ties: MutableWrapperSequence[NetTieDefinition]¶
The net-tie groups defined in this footprint
Added in version 0.9.0: (KiCad 10.0.7)
- property private_layers: list[int]¶
The private layers of this footprint, which are removed alongside the footprint
Added in version 0.9.0: (KiCad 10.0.7)
- property shapes: Sequence[BoardShape]¶
Returns all graphic shapes in the footprint
- property texts: Sequence[BoardText | BoardTextBox | Field]¶
Returns all fields and free text objects in the footprint library definition
- class Footprint3DModel(proto: Footprint3DModel | None = None, proto_ref: Footprint3DModel | None = None)¶
Represents a 3D model associated with a footprint
- property filename: str¶
- property opacity: float¶
- property visible: bool¶
- class FootprintAttributes(proto: FootprintAttributes | None = None, proto_ref: FootprintAttributes | None = None)¶
The built-in attributes that a Footprint or FootprintInstance may have
- property allow_soldermask_bridges: bool¶
- property description: str¶
- property do_not_populate: bool¶
- property exclude_from_bill_of_materials: bool¶
- property exclude_from_position_files: bool¶
- property exclude_from_simulation: bool¶
- property exempt_from_courtyard_requirement: bool¶
- property keywords: str¶
- property mounting_style: int¶
The mounting style of the footprint (SMD, through-hole, or unspecified)
Added in version 0.3.0: with KiCad 9.0.1
- property not_in_schematic: bool¶
- class FootprintDesignRuleOverrides(proto: FootprintDesignRuleOverrides | None = None, proto_ref: FootprintDesignRuleOverrides | None = None)¶
Footprint design rule overrides: all values are optional; if absent, the rules from the board will be used.
Added in version 0.8.0.
- property copper_clearance: int | None¶
- property solder_mask: SolderMaskOverrides | None¶
- property solder_paste: SolderPasteOverrides | None¶
- property zone_connection: int¶
- class FootprintInstance(proto: FootprintInstance | None = None)¶
Represents a footprint instance on a board
- property attributes: FootprintAttributes¶
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property embedded_files: EmbeddedFiles | None¶
Files embedded in this footprint instance
Added in version 0.9.0: (KiCad 10.0.7)
- property id: KIID¶
- property layer: int¶
The layer on which the footprint is placed (BoardLayer.BL_F_Cu or BoardLayer.BL_B_Cu)
NOTE: Do not use this property to try to flip an existing footprint to the other side of a board. Use
flip_items()orflip_items_by_id()instead.
- property locked: bool¶
- property overrides: FootprintDesignRuleOverrides¶
Returns the design rule overrides for the footprint
Added in version 0.8.0.
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property proto¶
- property sheet_path: SheetPath¶
The path to this footprint instance’s corresponding symbol schematic sheet
Added in version 0.4.0: with KiCad 9.0.3
- property symbol_sheet_filename: str¶
The filename of the hierarchical sheet the associated symbol for this footprint exists, on, or the empty string if there is no associated symbol.
..versionadded:: 0.9.0 (KiCad 9.0.7)
- property symbol_sheet_name: str¶
The name of the hierarchical sheet the associated symbol for this footprint exists on, or the empty string if there is no associated symbol.
..versionadded:: 0.9.0 (KiCad 9.0.7)
- property texts_and_fields: Sequence[BoardText | BoardTextBox | Field]¶
Returns all fields and free text objects in the footprint
- class GridItem(proto: GridItem | None = None, proto_ref: GridItem | None = None)¶
A local grid placed on the board.
Added in version 0.x.0: (KiCad 11)
- property affects: GridItemAffects¶
- property cartesian: CartesianGridItemAttributes | None¶
Cartesian grid geometry, or None if the grid is polar
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
- property id: KIID¶
- property locked: bool¶
- property polar: PolarGridItemAttributes | None¶
Polar grid geometry, or None if the grid is cartesian
- property priority: int¶
- property tick_interval: int¶
Every Nth line is drawn ephasized; 0 for no major ticks
- class GridItemAffects(proto: GridItemAffects | None = None, proto_ref: GridItemAffects | None = None)¶
Which actions a grid item affects
Added in version 0.x.0: (KiCad 11)
- property cursor: bool¶
- property placement: bool¶
- property routing: bool¶
- class Group(proto: Group | None = None)¶
Represents a group of items on a board
Groups store item membership by ID only. See the documentation for
itemsanditem_idsfor details.Added in version 0.7.0: (KiCad 10.0.0)
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property id: KIID¶
- property item_ids: Sequence[KIID]¶
The IDs of the group members
- property items: Sequence[BoardItem]¶
The members of the group, lazily resolved into actual item wrappers.
Accessing this property will cause API traffic to resolve the items by their KIID from the document.
Note that the group does not own these items;
item_idsis the actual way that group membership is tracked. This means that you cannot just add items to a group and then to a document by setting thisitemsproperty, you also need to add the items to the document separately.
- property lib_id: LibraryIdentifier¶
The design block identifier for groups linked to a design block library entry
Added in version 0.9.0: (KiCad 10.0.7)
- property locked: bool¶
Added in version 0.9.0.
- property name: str¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- class HatchFillSettings(proto: HatchFillSettings | None = None, proto_ref: HatchFillSettings | None = None)¶
Hatch fill settings for a copper zone
Added in version 0.9.0: (KiCad 10.0.7)
- property border_mode: int¶
- property gap: int¶
- property hatch_hole_min_area_ratio: float¶
- property hatch_smoothing_ratio: float¶
- property thickness: int¶
- class JumperGroup(proto: JumperGroup | None = None, proto_ref: JumperGroup | None = None)¶
A group of pad names in a footprint that are jumpered together
Added in version 0.9.0: (KiCad 10.0.7)
- property pad_names: list[str]¶
- class JumperSettings(proto: JumperSettings | None = None, proto_ref: JumperSettings | None = None)¶
Jumper settings for a footprint
Added in version 0.9.0: (KiCad 10.0.7)
- property duplicate_names_are_jumpered: bool¶
If true, duplicate pad names in this footprint are jumpered together
- property groups: MutableWrapperSequence[JumperGroup]¶
- class LeaderDimension(proto: Dimension | None = None, proto_ref: Dimension | None = None)¶
- property border_style: int¶
- class Net(proto: Net | None = None, name: str | None = None)¶
- property code: int¶
Deprecated since version 0.4.0.
- property name: str¶
- class NetTieDefinition(proto: NetTieDefinition | None = None, proto_ref: NetTieDefinition | None = None)¶
Definition of one net-tie group in a footprint: a set of pad numbers that are shorted together
Added in version 0.9.0: (KiCad 10.0.7)
- property pad_numbers: list[str]¶
- class OrthogonalDimension(proto: Dimension | None = None, proto_ref: Dimension | None = None)¶
- property alignment: int¶
- property extension_height: int¶
- property height: int¶
- class Pad(proto: Pad | None = None, proto_ref: Pad | None = None)¶
- property copper_clearance_override: int | None¶
Copper-to-copper clearance override in nanometers
Added in version 0.9.0.
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property fab_property: int¶
Fabrication property of the pad
Added in version 0.x.0: (KiCad 10.0.7)
- property id: KIID¶
- property number: str¶
- property pad_to_die_delay: int | None¶
Pad-to-die delay in attoseconds
Added in version 0.9.0.
- property pad_to_die_length: int¶
Added in version 0.5.0: (with KiCad 9.0.4)
- property pad_type: int¶
The type of the pad (PTH, NPTH, SMD, or edge connector). Note that there is not a direct mapping between pad type and padstack properties; it is currently up to the user to ensure that the value of this property and the padstack properties are consistent.
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property sim_electrical_type: int¶
The electrical type of this pad for simulation purposes
Added in version 0.9.0.
- property symbol_pin: SymbolPinInfo¶
Information about the associated symbol pin, if one exists
Added in version 0.9.0: (KiCad 10.0.7)
- property teardrop: PadTeardropSettings¶
Teardrop settings for this pad
Added in version 0.9.0: (KiCad 10.0.7)
- class PadStack(proto: PadStack | None = None, proto_ref: PadStack | None = None)¶
-
- property back_outer_layers: PadStackOuterLayer¶
Solder mask and paste settings for the back
- property back_post_machining: PostMachiningProperties¶
Added in version 0.9.0.
- copper_layer(layer: int) PadStackLayer | None¶
- property copper_layers: MutableWrapperSequence[PadStackLayer]¶
- property drill: DrillProperties¶
Properties of the drilled hole in this padstack, if it has one
- property front_outer_layers: PadStackOuterLayer¶
Solder mask and paste settings for the front
- property front_post_machining: PostMachiningProperties¶
Added in version 0.9.0.
- is_masked(layer: int = 1) bool¶
Returns true if the padstack is masked on the given copper layer, or on either layer if layer is
BL_UNDEFINED.
- property layers: Sequence[int]¶
- property secondary_drill: DrillProperties¶
Added in version 0.9.0.
- property tertiary_drill: DrillProperties¶
Added in version 0.9.0.
- property type: int¶
What type of pad stack this represents.
- property unconnected_layer_removal: int¶
How to treat pad shapes on unconnected layers.
- property zone_settings: ZoneConnectionSettings¶
Controls for how copper zones connect to the padstack
- class PadStackLayer(proto: PadStackLayer | None = None, proto_ref: PadStackLayer | None = None)¶
- property chamfer_ratio: float¶
How much to round the corners of the shape by, as a fraction of min(size.x, size.y) Only used for
PSS_CHAMFEREDRECT
- property chamfered_corners: ChamferedRectCorners¶
- property corner_rounding_ratio: float¶
How much to round the corners of the shape by, as a fraction of min(size.x, size.y) Only used for
PSS_ROUNDRECTorPSS_CHAMFEREDRECT
- property custom_anchor_shape: int¶
If shape ==
PSS_CUSTOM, defines the shape of the anchor (onlyPSS_CIRCLEandPSS_RECTANGLEsupported at present)
- property custom_shapes: MutableWrapperSequence[BoardShape]¶
The shapes that make up a custom-shape pad on this layer
- property layer: int¶
The board layer of this padstack entry. For Front/Inner/Back padstacks, In1_Cu is used to represent inner layers.
- property offset: Vector2¶
The offset of the center of this shape from the center of the pad (which is defined as the hole center)
- property shape: int¶
The shape of the pad on this layer
- property trapezoid_delta: Vector2¶
The difference in side length between the short and long pads in a trapezoid. Only one of x or y may be nonzero. Only used for
PSS_TRAPEZOID
- property zone_settings: ZoneConnectionSettings¶
Reserved for future use – at the moment, zone connection settings are not per-layer
- class PadStackOuterLayer(proto: PadStackOuterLayer | None = None, proto_ref: PadStackOuterLayer | None = None)¶
- property covering_mode: int¶
Added in version 0.9.0: (KiCad 10.0.7)
- property plugging_mode: int¶
Added in version 0.9.0: (KiCad 10.0.7)
- property solder_mask_mode: int¶
- property solder_mask_settings: SolderMaskOverrides¶
NOTE: At present, KiCad does not support different solder mask expansion settings for the top and bottom layers
- property solder_paste_mode: int¶
- property solder_paste_settings: SolderPasteOverrides¶
NOTE: At present, KiCad does not support different solder paste expansion settings for the top and bottom layers
- class PadTeardropSettings(proto: PadTeardropSettings | None = None, proto_ref: PadTeardropSettings | None = None)¶
Settings for teardrops applied to pads and vias
Added in version 0.9.0: (KiCad 10.0.7)
- property allow_multiple_track_segments: bool¶
True to allow a teardrop to extend over multiple connected track segments if the first segment is too short to achieve the best teardrop length
- property best_length_ratio: float¶
Preferred teardrop length as a ratio of the pad/via size
- property best_width_ratio: float¶
Preferred teardrop width as a ratio of the pad/via size
- property curved_edges: bool¶
- property max_length: int | None¶
Maximum teardrop length in nanometers, or None if no constraint is applied
- property max_track_width_ratio: float¶
Maximum ratio between the pad/via size and connected track width that will create a teardrop (1.0 always creates a teardrop; 0.0 never does)
- property max_width: int | None¶
Maximum teardrop width in nanometers, or None if no constraint is applied
- property mode: int¶
Whether to enable teardrops
- property prefer_zone_connection: bool¶
True to prefer zone connections over teardrops for pads connected to a copper zone
- class PolarGridItemAttributes(proto: PolarGridItemAttributes | None = None, proto_ref: PolarGridItemAttributes | None = None)¶
Added in version 0.x.0: (KiCad 11)
- property radius_extent: int¶
Radial extent from the center
- property radius_spacing: int¶
Radial spacing of snap points
- class PostMachiningProperties(proto: PostMachiningProperties | None = None, proto_ref: PostMachiningProperties | None = None)¶
Post-machining properties for a drill (counterbore or countersink)
Added in version 0.9.0.
- property angle: int¶
- property depth: int¶
- property mode: int¶
- property size: int¶
- class RadialDimension(proto: Dimension | None = None, proto_ref: Dimension | None = None)¶
-
- property leader_length: int¶
- class ReferenceImage(proto: ReferenceImage | None = None, proto_ref: ReferenceImage | None = None)¶
Represents a reference image on a board (a non-plotting bitmap)
Added in version 0.7.0: (KiCad 10.0.1)
- property image_data: bytes¶
- property image_scale: float¶
- property layer: int¶
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- class ReferencePoint(proto: ReferencePoint | None = None, proto_ref: ReferencePoint | None = None)¶
Represents a reference point marker on a board
Added in version 0.9.0: (KiCad 10.0.7)
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property id: KIID¶
- property layer: int¶
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
- property size: int¶
Marker size in nanometers
- class RuleAreaSettings(proto: RuleAreaSettings | None = None, proto_ref: RuleAreaSettings | None = None)¶
Settings that apply only to rule area zones
Added in version 0.9.0.
- property keepout_copper: bool¶
- property keepout_footprints: bool¶
- property keepout_pads: bool¶
- property keepout_tracks: bool¶
- property keepout_vias: bool¶
- property placement_enabled: bool¶
- property placement_source: str¶
- property placement_source_type: int¶
- class SolderMaskOverrides(proto: SolderMaskOverrides | None = None, proto_ref: SolderMaskOverrides | None = None)¶
- property expose_copper: bool¶
Whether to expose (remove) solder mask over this item
Added in version 0.9.0: (KiCad 10.0.7)
- property solder_mask_margin: int | None¶
Solder mask expansion/contraction. Absence of this field means the margin will be taken from this object’s parent or the board design rules.
- class SolderPasteOverrides(proto: SolderPasteOverrides | None = None, proto_ref: SolderPasteOverrides | None = None)¶
- property solder_paste_margin: int | None¶
Solder paste expansion/contraction
- property solder_paste_margin_ratio: float | None¶
Solder paste expansion/contraction ratio
- class SymbolPinInfo(proto: SymbolPinInfo | None = None, proto_ref: SymbolPinInfo | None = None)¶
Information about the symbol pin associated with a pad, if one exists
Added in version 0.9.0: (KiCad 10.0.7)
- property name: str¶
The pin name for the associated symbol pin (empty if none exists)
- property no_connect: bool¶
True if the pin is attached to a no-connect marker in the schematic
- property type: int¶
The electrical type of the associated symbol pin (
EPT_UNKNOWNif not)
- class Table(proto: Table | None = None, proto_ref: Table | None = None)¶
Represents a table on a board or footprint
Added in version 0.9.0: (KiCad 10.0.7)
- property border_stroke: StrokeAttributes¶
- property column_count: int¶
- property column_separators: int¶
- property column_widths: list[int]¶
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property external_border: int¶
- property header_separator: int¶
- property id: KIID¶
- property layer: int¶
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
- property row_heights: list[int]¶
- property row_separators: int¶
- property separators_stroke: StrokeAttributes¶
- class TableCell(proto: TableCell | None = None, proto_ref: TableCell | None = None)¶
A single cell of a table
Added in version 0.9.0: (KiCad 10.0.7)
- property column_span: int¶
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property row_span: int¶
- property text: BoardTextBox¶
- class ThermalSpokeSettings(proto: ThermalSpokeSettings | None = None, proto_ref: ThermalSpokeSettings | None = None)¶
-
- property gap: int | None¶
- property width: int | None¶
- class ThievingFillSettings(proto: ThievingFillSettings | None = None, proto_ref: ThievingFillSettings | None = None)¶
Thieving fill (fill pattern that is not connected to any net) settings for a copper zone
Added in version 0.x.0: (KiCad 11)
- property element_size: int¶
- property gap: int¶
- property line_width: int¶
- property pattern: int¶
- property stagger: bool¶
- class Track(proto: Track | None = None, proto_ref: Track | None = None)¶
Represents a straight track segment
- property layer: int¶
- length() float¶
Calculates track length in nanometers
- property locked: bool¶
Added in version 0.6.0.
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property solder_mask: SolderMaskOverrides¶
Solder mask overrides for this track
Added in version 0.9.0: (KiCad 10.0.7)
- property width: int¶
- class Via(proto: Via | None = None, proto_ref: Via | None = None)¶
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property diameter: int¶
A helper property to get or set the diameter of the via on all copper layers.
Warning: only makes sense if the via’s padstack mode is
PST_NORMAL. This will return the pad diameter on the front copper layer otherwise. Setting this property will set the padstack mode toPST_NORMALas a side-effect.To get or set the diameter for other padstack types, use the
padstackproperty directly.Added in version 0.3.0: with KiCad 9.0.1
- property drill_diameter: int¶
The diameter of the via’s drill (KiCad only supports circular drills in vias)
- property is_free: bool¶
Whether the via is a free (locked-from-autorouter perspective) via
Added in version 0.9.0: (KiCad 10.0.7)
- property locked: bool¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property teardrop: PadTeardropSettings¶
Teardrop settings for this via
Added in version 0.9.0: (KiCad 10.0.7)
- property type: int¶
The type of the via (through, blind/buried, or micro)
Setting this property will also update the padstack drill start and end layers as a side effect.
Added in version 0.3.0: with KiCad 9.0.1
- class Zone(proto: Zone | None = None, proto_ref: Zone | None = None)¶
Represents a copper, graphical, or rule area zone on a board
- property border_hatch_pitch: int¶
- property border_style: int¶
- property clearance: int | None¶
The override (local) clearance for this filled copper zone
- property connection: ZoneConnectionSettings | None¶
- property corner_radius: int | None¶
Corner radius in nanometers for this copper zone
Added in version 0.9.0: (KiCad 10.0.7)
- property corner_smoothing: int | None¶
Corner smoothing mode for this copper zone
Added in version 0.9.0: (KiCad 10.0.7)
- property custom_properties: MutableWrapperSequence[CustomProperty]¶
Added in version 0.x.0: (KiCad 11)
- property fill_mode: int | None¶
- property filled: bool¶
- property filled_polygons: dict[int, list[PolygonWithHoles]]¶
- property hatch_settings: HatchFillSettings | None¶
Hatch fill settings for this copper zone
Added in version 0.x.0.
- is_rule_area() bool¶
- property island_mode: int | None¶
- property layer_properties: MutableWrapperSequence[ZoneLayerProperties]¶
Per-layer properties for this zone
Added in version 0.9.0.
- property layers: Sequence[int]¶
- property locked: bool¶
- property min_island_area: int | None¶
- property min_thickness: int | None¶
- property name: str¶
- property outline: PolygonWithHoles¶
- property parent: KIID | None¶
The ID of the parent container for this item (such as a Board or Footprint), if any. Read-only; item parents can only be changed by add/remove calls on the parent container.
Added in version 0.8.0: (KiCad 10.0.6)
- property priority: int¶
- rotate(angle: Angle, center: Vector2)¶
Rotates the zone by the given angle around the given center point
- property rule_area_settings: RuleAreaSettings | None¶
Settings that apply only to rule area zones; None for copper zones
Added in version 0.9.0.
- property teardrop: ZoneTeardropSettings | None¶
- property thieving_settings: ThievingFillSettings | None¶
Thieving fill settings for this copper zone
Added in version 0.x.0: (KiCad 11)
- property type: int¶
- class ZoneConnectionSettings(proto: ZoneConnectionSettings | None = None, proto_ref: ZoneConnectionSettings | None = None)¶
- property thermal_spokes: ThermalSpokeSettings¶
- property zone_connection: int¶
- class ZoneFilledPolygons(proto: ZoneFilledPolygons | None = None, proto_ref: ZoneFilledPolygons | None = None)¶
Represents the set of filled polygons of a zone on a single board layer
- property layer: int¶
- property shapes: Sequence[PolygonWithHoles]¶
- class ZoneLayerProperties(proto: ZoneLayerProperties | None = None, proto_ref: ZoneLayerProperties | None = None)¶
Layer-specific properties for a zone
Added in version 0.9.0.
- property layer: int¶
- to_concrete_board_shape(shape: BoardShape) BoardShape¶
- unwrap(message: Any) Wrapper¶
Board Jobs¶
Classes related to board output jobs (file exports)
- class DrillExportSettings(proto: RunBoardJobExportDrill | None = None, proto_ref: RunBoardJobExportDrill | None = None)¶
Settings for drill export job.
- property excellon: ExcellonFormatOptions¶
- property format: int¶
- property gerber_generate_tenting: bool | None¶
- property gerber_precision: int¶
When generating drill files in Gerber format, the precision to use for coordinates
- property map_format: int¶
Set to a valid value to generate a drill map. Leave unset for no drill map.
- property origin: int¶
- property report_filename: str | None¶
- property report_format: int¶
Set to a valid value to generate a drill report. Leave unset for no report.
- property units: int¶
Inches or millimeters are accepted
- property zeros_format: int¶
- class DxfExportSettings(proto: RunBoardJobExportDxf | None = None, proto_ref: RunBoardJobExportDxf | None = None)¶
Settings for DXF export job.
- property page_mode: int¶
Supports
BJPM_ALL_LAYERS_ONE_PAGEandBJPM_EACH_LAYER_OWN_FILE.
- property plot_graphic_items_using_contours: bool¶
- property plot_settings: PlotSettings¶
- property polygon_mode: bool¶
- property units: int¶
Inches or millimeters are accepted
- class ExcellonFormatOptions(proto: ExcellonFormatOptions | None = None, proto_ref: ExcellonFormatOptions | None = None)¶
Excellon-specific options for drill export.
- property combine_pth_npth: bool | None¶
- property minimal_header: bool | None¶
- property mirror_y: bool | None¶
- property route_oval_holes: bool | None¶
- class Export3DSettings(proto: RunBoardJobExport3D | None = None, proto_ref: RunBoardJobExport3D | None = None)¶
Settings for 3D model export job
- property board_only: bool¶
- property board_outlines_chaining_epsilon: float¶
- property component_filter: str¶
- property cut_vias_in_body: bool¶
- property export_board_body: bool¶
- property export_components: bool¶
- property export_inner_copper: bool¶
- property export_pads: bool¶
- property export_silkscreen: bool¶
- property export_soldermask: bool¶
- property export_tracks_and_vias: bool¶
- property export_zones: bool¶
- property extra_pad_thickness: bool¶
- property fill_all_vias: bool¶
- property format: int¶
- property fuse_shapes: bool¶
- property has_user_origin: bool¶
- property include_dnp: bool¶
- property include_unspecified: bool¶
- property net_filter: str¶
- property optimize_step: bool¶
- property overwrite: bool¶
- property substitute_models: bool¶
- property use_defined_origin: bool¶
- property use_drill_origin: bool¶
- property use_grid_origin: bool¶
- property use_pcb_center_origin: bool¶
- property variant: str¶
- property vrml_model_dir: str¶
- property vrml_relative_paths: bool¶
- property vrml_units: int¶
Inches, millimeters, meters, or tenths of an inch are accepted
- class GencadExportSettings(proto: RunBoardJobExportGencad | None = None, proto_ref: RunBoardJobExportGencad | None = None)¶
Settings for GenCAD export job.
- property flip_bottom_pads: bool¶
- property store_origin_coords: bool¶
- property use_drill_origin: bool¶
- property use_individual_shapes: bool¶
- property use_unique_pins: bool¶
- class GerberExportSettings(proto: RunBoardJobExportGerbers | None = None, proto_ref: RunBoardJobExportGerbers | None = None)¶
Settings for Gerber export job.
- property create_gerber_job_file: bool¶
If true, a Gerber job file (.gbrjob) is created alongside the plot outputs.
- property disable_aperture_macros: bool¶
If true, aperture macros are disabled in the plot outputs.
- property include_netlist_attributes: bool¶
If true, Gerber X2 netlist attributes are included in the plot outputs.
- property plot_settings: PlotSettings¶
- property precision: int¶
- property use_board_plot_params: bool¶
If true, the Gerber plot settings stored in the board file are used instead of the settings provided in this class. When set, the layers list is derived from the board’s plot layer selection.
- property use_protel_file_extensions: bool¶
If true, Protel-style file extensions are used (e.g. .gbr → .gtl).
- property use_x2_format: bool¶
If true, Gerber X2 format is used.
- class Ipc2581ExportSettings(proto: RunBoardJobExportIpc2581 | None = None, proto_ref: RunBoardJobExportIpc2581 | None = None)¶
Settings for IPC-2581 export job.
- property bom_revision: str¶
- property compress: bool¶
- property distributor_column: str¶
- property distributor_part_number_column: str¶
- property drawing_sheet: str¶
- property internal_id_column: str¶
- property manufacturer_column: str¶
- property manufacturer_part_number_column: str¶
- property precision: int | None¶
- property units: int¶
Inches or millimeters are accepted
- property variant: str¶
- property version: int¶
- class IpcD356ExportSettings(proto: RunBoardJobExportIpcD356 | None = None, proto_ref: RunBoardJobExportIpcD356 | None = None)¶
Settings for IPC-D-356 export job.
- class OdbExportSettings(proto: RunBoardJobExportODB | None = None, proto_ref: RunBoardJobExportODB | None = None)¶
Settings for ODB++ export job.
- property compression: int¶
- property drawing_sheet: str¶
- property precision: int | None¶
- property units: int¶
Inches or millimeters are accepted
- property variant: str¶
- class PdfExportSettings(proto: RunBoardJobExportPdf | None = None, proto_ref: RunBoardJobExportPdf | None = None)¶
Settings for PDF export job.
- property back_footprint_property_popups: bool¶
- property background_color: str¶
- property front_footprint_property_popups: bool¶
- property include_metadata: bool¶
- property page_mode: int¶
- property plot_settings: PlotSettings¶
- property single_document: bool¶
- class PlotSettings(proto: BoardPlotSettings | None = None, proto_ref: BoardPlotSettings | None = None)¶
Shared settings for board plotting jobs
- property black_and_white: bool¶
- property check_zones_before_plot: bool¶
- property color_theme: str¶
- property common_layers: list[int]¶
- property crossout_dnp_footprints_on_fab_layers: bool¶
- property drawing_sheet: str¶
- property drill_marks: int¶
- property hide_dnp_footprints_on_fab_layers: bool¶
- property layers: list[int]¶
The layers to plot. Jobs will generally fail if no layers are specified.
- property mirror: bool¶
- property negative: bool¶
- property plot_drawing_sheet: bool¶
- property plot_footprint_values: bool¶
- property plot_pad_numbers: bool¶
- property plot_reference_designators: bool¶
- property scale: float¶
- property sketch_dnp_footprints_on_fab_layers: bool¶
- property sketch_pads_on_fab_layers: bool¶
- property subtract_solder_mask_from_silk: bool¶
- property use_drill_origin: bool¶
- property variant: str¶
- class PositionExportSettings(proto: RunBoardJobExportPosition | None = None, proto_ref: RunBoardJobExportPosition | None = None)¶
Settings for position file export job.
- property exclude_dnp: bool¶
- property exclude_footprints_with_th: bool¶
- property exclude_from_bom: bool¶
- property format: int¶
- property include_board_edge_for_gerber: bool | None¶
- property naked_filename: bool¶
- property negate_bottom_x: bool¶
- property side: int¶
- property single_file: bool¶
- property smd_only: bool¶
- property units: int¶
Inches or millimeters are accepted
- property use_drill_place_file_origin: bool | None¶
- property variant: str¶
- class PsExportSettings(proto: RunBoardJobExportPs | None = None, proto_ref: RunBoardJobExportPs | None = None)¶
Settings for PostScript export job.
- property force_a4: bool¶
- property page_mode: int¶
Supports
BJPM_ALL_LAYERS_ONE_PAGEandBJPM_EACH_LAYER_OWN_FILE.
- property plot_settings: PlotSettings¶
- property track_width_correction: float¶
- property use_global_settings: bool¶
- property x_scale_adjust: float¶
- property y_scale_adjust: float¶
- class RenderSettings(proto: RunBoardJobExportRender | None = None, proto_ref: RunBoardJobExportRender | None = None)¶
Settings for 3D render export job.
- property anti_alias: bool¶
- property appearance_preset: str¶
- property background_style: int¶
- property floor: bool¶
- property format: int¶
- property height: int¶
- property light_side_elevation: int¶
- property perspective: bool¶
- property post_process: bool¶
- property procedural_textures: bool¶
- property quality: int¶
- property side: int¶
- property use_board_stackup_colors: bool¶
- property width: int¶
- property zoom: float¶
- class StatsExportSettings(proto: RunBoardJobExportStats | None = None, proto_ref: RunBoardJobExportStats | None = None)¶
Settings for board statistics export job.
- property exclude_footprints_without_pads: bool¶
- property format: int¶
- property subtract_holes_from_board_area: bool¶
- property subtract_holes_from_copper_areas: bool¶
- property units: int¶
Inches or millimeters are accepted
- class SvgExportSettings(proto: RunBoardJobExportSvg | None = None, proto_ref: RunBoardJobExportSvg | None = None)¶
Settings for SVG export job.
- property fit_page_to_board: bool¶
- property page_mode: int¶
Supports
BJPM_ALL_LAYERS_ONE_PAGEandBJPM_EACH_LAYER_OWN_FILE.
- property plot_settings: PlotSettings¶
- property precision: int¶