altium monkey v2026.11.26 · gobblerito
On This Page (60)

PCB, Footprints & Stackups

AltiumPcbDoc, AltiumPcbLib, V7 layer references, builders, and layer stacks.

204 / 204 shown
class

AltiumBoardBendLine

from altium_monkey.altium_layer_stack_document import AltiumBoardBendLine
class AltiumBoardBendLine(angle_deg: 'float | None' = None, radius_raw: 'int | None' = None, fold_index: 'int | None' = None, x1: 'int | None' = None, y1: 'int | None' = None, x2: 'int | None' = None, y2: 'int | None' = None, name: 'str' = '', state_raw: 'str' = '', region_name: 'str' = '', raw_value: 'str' = '') -> 'None'

Native top-level Board6/Data bend-line cache entry.

AD26 stores bend lines twice: the board-region-local geometry lives in BoardRegions/Data, while the top-level Board6 segment carries the Layer Stack Manager cache used by the editor. The coordinate systems are not interchangeable, so this model keeps the Board6 value source-aware.

Members (4)
KindSignatureSummary
classmethodfrom_property_value(cls, raw_value: 'object') -> "'AltiumBoardBendLine'"
propertyradius_mils -> 'float | None'Bend radius in mils, derived from the native raw coordinate value.
methodto_debug_json(self) -> 'dict[str, object]'
methodto_property_value(self) -> 'str'
class

AltiumBoardOutline

from altium_monkey import AltiumBoardOutline
class AltiumBoardOutline(vertices: 'list[BoardOutlineVertex]' = <factory>, cutouts: 'list[list[BoardOutlineVertex]]' = <factory>) -> 'None'

Board outline geometry.

Primary source: VX0/VY0..VXn/VYn indexed fields in Board6/Data record.

The outline is a closed polygon defined by ordered vertices. Cutouts are holes in the board (e.g., mounting slots) from regions marked as board cutouts.

Members (5)
KindSignatureSummary
propertybounding_box -> 'tuple[float, float, float, float]'Returns (min_x, min_y, max_x, max_y) in mils.
classmethodfrom_points_mils(cls, points_mils: 'list[tuple[float, float]] | tuple[tuple[float, float], ...]') -> 'AltiumBoardOutline'Create a straight-segment outline from footprint-plane point tuples.
propertypoints_mils -> 'tuple[tuple[float, float], ...]'Return outline vertex coordinates as `(x_mils, y_mils)` tuples.
classmethodrectangle_mils(cls, *, left_mils: 'float', bottom_mils: 'float', right_mils: 'float', top_mils: 'float') -> 'AltiumBoardOutline'Create a rectangular outline from explicit mil-unit bounds.
propertyvertex_count -> 'int'Number of ordered outer-outline vertices.
class

AltiumCopperMaterialSpec

from altium_monkey import AltiumCopperMaterialSpec
class AltiumCopperMaterialSpec(material: 'str' = '', entity_ref: 'str' = '', weight: 'str' = '', process: 'str' = '', manufacturer: 'str' = '', description: 'str' = '', copper_orientation: 'int | None' = None) -> 'None'

Semantic copper material metadata for authored rigid copper rows.

`material` can be a display material name. `entity_ref` is available for advanced callers that need to preserve an Altium material-library reference, but ordinary public examples should not require one.

class

AltiumDielectricMaterialSpec

from altium_monkey import AltiumDielectricMaterialSpec
class AltiumDielectricMaterialSpec(name: 'str', construction: 'str' = '', resin: 'str' = '', frequency: 'str' = '', dielectric_constant: 'float | None' = None, loss_tangent: 'float | None' = None, glass_transition_temperature: 'str' = '', manufacturer: 'str' = '', description: 'str' = '') -> 'None'

Semantic dielectric material metadata for StackupX-capable rigid rows.

The writer translates these fields into the native StackupX property names and type strings. Callers should not need to know the serialized property tuple shape for common material fields.

class

AltiumImpedanceProfile

from altium_monkey.altium_layer_stack_document import AltiumImpedanceProfile
class AltiumImpedanceProfile(index: 'int', source_family: 'str', source_record_id: 'str', name: 'str', profile_type: 'str' = '', profile_type_raw: 'int | None' = None, impedance: 'str' = '', tolerance: 'str' = '', transmission_line_count: 'int' = 0, custom_name: 'str | None' = None) -> 'None'

Impedance metadata; ``name`` is AutoName, ``custom_name`` an optional label.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumImpedanceProfileSpec

from altium_monkey import AltiumImpedanceProfileSpec
class AltiumImpedanceProfileSpec(name: 'str', impedance: 'str', profile_type: 'str' = 'Single', profile_type_raw: 'int | None' = None, tolerance: 'str' = '', transmission_lines: 'tuple[AltiumTransmissionLineSpec, ...]' = ()) -> 'None'

Authored Layer Stack Manager impedance-profile input for rigid stacks.

class

AltiumLayerPair

from altium_monkey import AltiumLayerPair
class AltiumLayerPair(pair_index: 'int', low_layer_token: 'str', high_layer_token: 'str', source_substack_refs: 'tuple[str, ...]' = (), drill_pair_type_raw: 'int | None' = None, is_backdrill: 'bool | None' = None, is_inverted: 'bool | None' = None, drill_guide: 'bool | None' = None, drill_drawing: 'bool | None' = None, stackupx_spans: 'tuple[AltiumLayerPairSpan, ...]' = ()) -> 'None'

Drill/via span metadata parsed from Board6/Data layer-pair rows.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumLayerPairSpan

from altium_monkey import AltiumLayerPairSpan
class AltiumLayerPairSpan(stack_ref: 'str', span_index: 'int', is_drill_span: 'bool', source_span_id: 'str' = '', auto_name: 'str' = '', span_type: 'str' = '', start_layer_id: 'str' = '', stop_layer_id: 'str' = '', *, _pair_state: 'tuple[str, str, int | None, bool | None, bool | None] | None' = None) -> 'None'

A scoped StackupX span retained while its owning layer pair is unchanged.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumLayerRegistry

from altium_monkey.altium_layer_stack_document import AltiumLayerRegistry
class AltiumLayerRegistry(entries: 'tuple[AltiumLayerRegistryEntry, ...]' = ()) -> 'None'

Deterministic registry of logical/editor layers.

Members (2)
KindSignatureSummary
methodentry_by_model_id(self, model_id: 'str') -> 'AltiumLayerRegistryEntry | None'
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumLayerRegistryEntry

from altium_monkey.altium_layer_stack_document import AltiumLayerRegistryEntry
class AltiumLayerRegistryEntry(model_id: 'str', display_name: 'str', family: 'str', standard_token: 'str | None' = None, legacy_layer_id: 'int | None' = None, v7_layer_id: 'int | None' = None, source_layer_id: 'int | None' = None, source_record_id: 'str' = '', side: 'str | None' = None, used_by_primitives: 'bool | None' = None, enabled: 'bool | None' = None, source_aliases: 'tuple[str, ...]' = ()) -> 'None'

One source-aware logical layer entry.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumLayerStackDocument

from altium_monkey import AltiumLayerStackDocument
class AltiumLayerStackDocument(layer_registry: 'AltiumLayerRegistry', physical_stacks: 'tuple[AltiumPhysicalStack, ...]', active_stack_ref: 'str | None' = None, rigid_flex_mode: 'str' = 'none', substacks: 'tuple[AltiumStackSubstack, ...]' = (), stackupx_auxiliary_stacks: 'tuple[AltiumStackSubstack, ...]' = (), branches: 'tuple[AltiumStackBranch, ...]' = (), board_regions: 'tuple[AltiumStackRegion, ...]' = (), layer_pairs: 'tuple[AltiumLayerPair, ...]' = (), board_split_lines: 'tuple[str, ...]' = (), board_bending_lines: 'tuple[AltiumBoardBendLine, ...]' = (), board_arc_split_lines: 'tuple[str, ...]' = (), materials: 'tuple[object, ...]' = (), impedance_profiles: 'tuple[AltiumImpedanceProfile, ...]' = (), transmission_lines: 'tuple[AltiumTransmissionLine, ...]' = (), stackup_attributes: 'tuple[tuple[str, str], ...]' = (), stackupx_serializer_version: 'str' = '', stackupx_version: 'str' = '', stackupx_document_id: 'str' = '', stackupx_revision_id: 'str' = '', stackupx_revision_date: 'str' = '', stackupx_features: 'tuple[tuple[str, str], ...]' = (), source: 'AltiumLayerStackSourceMap' = <factory>, stackupx_span_diagnostics: 'tuple[tuple[str, str], ...]' = ()) -> 'None'

Root source-aware PcbDoc layer-stack model.

Members (37)
KindSignatureSummary
methodboard_region_by_name(self, name: 'str') -> 'AltiumStackRegion | None'Lookup one board stack region by display name.
methodboard_regions_for_layerstack_id(self, layerstack_id: 'str') -> 'tuple[AltiumStackRegion, ...]'Return board regions assigned to a native substack GUID/ref.
methodbranches_for_stack_ref(self, stack_ref: 'str') -> 'tuple[AltiumStackBranch, ...]'Return branch topology records that reference a stack GUID/ref.
classmethodcanonical_empty(cls) -> "'AltiumLayerStackDocument'"Build the model from the canonical empty PcbDoc builder profile.
classmethodfour_layer_rigid(cls) -> "'AltiumLayerStackDocument'"Build the existing four-layer rigid FR-4 template through the model.
classmethodfrom_board(cls, board: 'object', *, board_regions: 'tuple[object, ...] | list[object] | None' = None, ordered_stack_entries: 'tuple[str, ...]' = (), source_origin: 'str' = '') -> "'AltiumLayerStackDocument'"
classmethodfrom_board_data(cls, board_data: 'object', *, board_regions: 'tuple[object, ...] | list[object] | None' = None) -> "'AltiumLayerStackDocument'"
classmethodfrom_pcbdoc(cls, pcbdoc: 'object') -> "'AltiumLayerStackDocument'"
classmethodfrom_pcbdoc_builder_profile(cls, profile: 'object') -> "'AltiumLayerStackDocument'"
classmethodfrom_pcbdoc_layer_stack_template(cls, template: "'PcbDocLayerStackTemplate | str'", *, base_board_data: "'PcbDocBoardData | None'" = None) -> "'AltiumLayerStackDocument'"Build a source-aware layer-stack model from a PcbDoc builder template.
classmethodfrom_rigid_layer_rows(cls, *, name: 'str', rows: 'Sequence[AltiumRigidStackRowSpec | AltiumStackLayer | AltiumRigidCopperLayerSpec | AltiumRigidDielectricLayerSpec]', stack_ref: 'str | None' = None, substack_ref: 'str | None' = None, substack_name: 'str | None' = None, document_id: 'str | None' = None, layer_pairs: 'Sequence[AltiumLayerPair]' = (), impedance_profiles: 'Sequence[AltiumImpedanceProfile | AltiumImpedanceProfileSpec]' = (), transmission_lines: 'Sequence[AltiumTransmissionLine]' = (), stackup_settings: 'AltiumStackupSettings | None' = None, stackup_attributes: 'Sequence[tuple[str, str]]' = ()) -> "'AltiumLayerStackDocument'"Build a new-document rigid stack from an explicit physical row sequence.
classmethodfrom_rigid_stack(cls, *, name: 'str', copper_layers: 'Sequence[AltiumRigidCopperLayerSpec]', dielectrics_between: 'Sequence[AltiumRigidDielectricLayerSpec]', impedance_profiles: 'Sequence[AltiumImpedanceProfileSpec]' = (), base_board_data: "'PcbDocBoardData | None'" = None) -> "'AltiumLayerStackDocument'"Build a new-document rigid stack from typed copper/dielectric rows.
classmethodfrom_stackup(cls, source: 'object') -> "'AltiumLayerStackDocument'"Build the common layer-stack view from a `.stackup` text export.
classmethodfrom_stackupx(cls, source: 'object') -> "'AltiumLayerStackDocument'"Build the common layer-stack view from a `.stackupx` XML export.
methodlayers_for_board_region(self, board_region_or_layerstack_id: 'object') -> 'tuple[AltiumStackLayer, ...]'Return physical layers enabled for a board region or raw layerstack id.
methodlayers_for_substack(self, source_stackup_ref: 'str') -> 'tuple[AltiumStackLayer, ...]'Return physical layers enabled for a native substack GUID/ref.
methodnative_pcbdoc_write_support(self) -> 'AltiumNativePcbDocWriteSupport'Report whether this stack can be regenerated as native PcbDoc today.
methodphysical_stack_by_ref(self, stack_ref: 'str') -> 'AltiumPhysicalStack | None'Lookup a physical master stack by native stack GUID/ref.
propertystackup_settings -> 'AltiumStackupSettings'Return typed stackup-level Layer Stack Manager settings.
methodsubstack_by_source_ref(self, source_stackup_ref: 'str') -> 'AltiumStackSubstack | None'Lookup a rigid/flex substack by native stackup GUID/ref.
methodsubstacks_by_name(self, name: 'str') -> 'tuple[AltiumStackSubstack, ...]'Return all substacks with a matching display name.
methodto_authored_board_data_entries(self) -> 'tuple[str, ...]'Return ordered stack entries with typed model values overlaid.
methodto_board_data_entries(self) -> 'tuple[str, ...]'Return ordered Board6/Data stack entries captured from the source.
methodto_board_data_for_new_pcbdoc(self, *, base_board_data: "'PcbDocBoardData | None'" = None) -> "'PcbDocBoardData'"Build new-document `Board6/Data` with stack sections from this model.
methodto_board_regions_data_for_new_pcbdoc(self, *, base_board_regions_data: "'PcbDocBoardRegionsData | None'" = None) -> "'PcbDocBoardRegionsData'"Build new-document `BoardRegions/Data` from typed stack regions.
methodto_canonical_empty_board_data(self) -> "'PcbDocBoardData'"Build canonical empty `Board6/Data` with stack entries from this model.
methodto_debug_json(self) -> 'dict[str, object]'Return deterministic JSON-compatible debug data for tests and inspection.
methodto_resolved_layer_stack(self, *, primitive_layer_ids: 'set[int] | None' = None, drill_pairs: 'set[tuple[int, int]] | None' = None) -> 'object'Build the existing resolved consumer view from this model's source data.
methodto_stackup(self) -> "'AltiumStackupDocument'"Build an Altium `.stackup` text interchange document from this model.
methodto_stackup_text(self) -> 'str'Serialize this model as Altium `.stackup` text.
methodto_stackupx(self) -> "'AltiumStackupXDocument'"Build an Altium `.stackupx` XML interchange document from this model.
methodto_stackupx_text(self) -> 'str'Serialize this model as Altium `.stackupx` XML text.
classmethodtwo_layer_rigid(cls) -> "'AltiumLayerStackDocument'"Build the existing two-layer rigid FR-4 template through the model.
methodunsupported_source_field_buckets(self) -> 'dict[str, tuple[str, ...]]'Return layer-stack source fields preserved but not yet typed-authored.
methodwith_backdrill_span(self, low_layer: 'object', high_layer: 'object', *, pair_index: 'int | None' = None, source_substack_refs: 'Sequence[str] | None' = None, drill_pair_type_raw: 'int | None' = None, is_inverted: 'bool | None' = None, drill_guide: 'bool | None' = False, drill_drawing: 'bool | None' = False) -> "'AltiumLayerStackDocument'"Return a document with one authored Layer Stack Manager backdrill span.
methodwith_layer_pair(self, low_layer: 'object', high_layer: 'object', *, pair_index: 'int | None' = None, source_substack_refs: 'Sequence[str] | None' = None, drill_pair_type_raw: 'int | None' = None, is_backdrill: 'bool | None' = None, is_inverted: 'bool | None' = None, drill_guide: 'bool | None' = False, drill_drawing: 'bool | None' = False) -> "'AltiumLayerStackDocument'"Return a document with one authored layer-pair / drill-span row.
methodwith_via_span(self, low_layer: 'object', high_layer: 'object', *, pair_index: 'int | None' = None, source_substack_refs: 'Sequence[str] | None' = None, drill_pair_type_raw: 'int | None' = None, is_inverted: 'bool | None' = None, drill_guide: 'bool | None' = False, drill_drawing: 'bool | None' = False) -> "'AltiumLayerStackDocument'"Return a document with one authored non-backdrill via span.
class

AltiumNativePcbDocWriteSupport

from altium_monkey.altium_layer_stack_document import AltiumNativePcbDocWriteSupport
class AltiumNativePcbDocWriteSupport(supported: 'bool', mode: 'str', reasons: 'tuple[str, ...]' = (), unsupported_source_field_buckets: 'tuple[tuple[str, tuple[str, ...]], ...]' = ()) -> 'None'

Current native PcbDoc semantic writer support summary.

Members (2)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'Return deterministic JSON-compatible diagnostic data.
methodunsupported_source_field_mapping(self) -> 'dict[str, tuple[str, ...]]'Return unsupported preserved source fields grouped by family.
class

AltiumPcbArc

from altium_monkey import AltiumPcbArc
class AltiumPcbArc() -> 'None'

PCB arc primitive record.

Represents a curved line segment on PCB (copper arc or silkscreen arc).

Attributes: center_x: Center X position (internal units, 10k/mil) center_y: Center Y position (internal units) radius: Arc radius (internal units) start_angle: Start angle (degrees, 0 deg = right, counterclockwise) end_angle: End angle (degrees) width: Line width (internal units) layer: Layer number (1=TOP, 32=BOTTOM, etc.) component_index: Links to component (uint16, PCB_UNLINKED_INDEX when unlinked) net_index: Links to net (uint16, PCB_UNLINKED_INDEX when unlinked) polygon_index: Polygon index (uint16) subpoly_index: Sub-polygon index (uint16) union_index: Union membership (uint32, 0xFFFFFFFF=none) is_locked: Locked for editing is_keepout: Keepout arc is_polygon_outline: Part of polygon outline user_routed: True if manually routed (flags1 bit 3) solder_mask_expansion: Solder mask expansion value (int32, internal units) paste_mask_expansion: Paste mask expansion value (uint8, always 0 in practice) v7_layer_id: V7 layer identifier field (uint32) keepout_restrictions: Keepout bitmask. Use `altium_pcb_keepout` helpers for the SDK-confirmed bit names.

Members (9)
KindSignatureSummary
propertycenter_x_mils -> 'float'Get center X in mils.
propertycenter_y_mils -> 'float'Get center Y in mils.
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this arc.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse ARC record from binary data.
propertyradius_mils -> 'float'Get radius in mils.
propertyrecord_type -> 'PcbRecordType'Return the PCB arc record discriminator.
methodserialize_to_binary(self) -> 'bytes'Serialize ARC record to binary format.
propertysigned_radius -> 'int'The saved radius as Altium reads it: a signed 32-bit coordinate.
class

AltiumPcbComponent

from altium_monkey.altium_pcb_component import AltiumPcbComponent
class AltiumPcbComponent(designator: 'str', footprint: 'str', layer: 'str', x: 'str', y: 'str', rotation: 'str' = '', unique_id: 'str' = '', union_index: 'int' = 0, description: 'str' = '', parameters: 'dict[str, object] | None' = None, raw_record: 'dict[str, object] | None' = None, component_kind: 'ComponentKind | int' = <ComponentKind.STANDARD: 0>, parameter_rows: 'tuple[tuple[str, str], ...]' = (), _source_payload: 'bytes | None' = None) -> 'None'

Component instance from Altium PcbDoc file.

This is an Altium-specific representation that stores raw fields from the Components6/Data stream in a PcbDoc file.

Attributes: designator: Component reference (e.g., "R1", "U1") footprint: Footprint name (PATTERN field) layer: Side of PCB ("TOP" or "BOTTOM" from LAYER field) x: X position with "mil" suffix (e.g., "27514.9995mil") y: Y position with "mil" suffix rotation: Rotation angle in scientific notation (e.g., "1.80000000000000E+0002" = 180 deg) unique_id: 8-character unique identifier (UNIQUEID field, linkage key for pads/parameters) union_index: User-union index from the component `UNIONINDEX` field. description: Component description (SOURCEDESCRIPTION field) parameters: Dict of component parameters from PrimitiveParameters/Data (the first row of each name) parameter_rows: Every (name, value) parameter row, in order, including rows that repeat a name raw_record: Original text record dict from Components6/Data component_kind: ComponentKind enum value (parsed from COMPONENTKIND/VERSION2/VERSION3 fields); a stored value outside ComponentKind is kept as its integer

Position Format: - Stored as string with "mil" suffix (Altium format) - Example: x="27514.9995mil", y="15000.0000mil" - Use get_x_mils() / get_y_mils() to get position as float

Members (28)
KindSignatureSummary
propertychannel_offset -> 'int | None'Numeric channel instance offset used by hierarchical/repeated projects.
propertycomment_auto_position -> 'PcbTextAutoposition | None'
propertycomment_on -> 'bool'
propertyenable_part_swapping -> 'bool | None'
propertyenable_pin_swapping -> 'bool | None'
propertyfootprint_description -> 'str'
methodget_layer_normalized(self) -> 'str'Get normalized layer string.
methodget_rotation_degrees(self) -> 'float'Get rotation in degrees.
methodget_x_mils(self, board_origin_x: 'float' = 0.0) -> 'float'Get X position in mils (relative to board origin).
methodget_y_mils(self, board_origin_y: 'float' = 0.0) -> 'float'Get Y position in mils (relative to board origin).
propertyheight -> 'str'
propertyjumpers_visible -> 'bool | None'
propertylock_strings -> 'bool | None'
propertylocked -> 'bool'Whether the component is locked (`LOCKED`); unlocked when omitted.
propertyname_auto_position -> 'PcbTextAutoposition | None'
propertyname_on -> 'bool'
propertysource_component_library -> 'str'
propertysource_component_library_identifier -> 'str'
propertysource_component_library_identifier_kind -> 'PcbLibIdentifierKind | None'
propertysource_designator -> 'str'
propertysource_footprint_library -> 'str'
propertysource_footprint_library_name -> 'str'
propertysource_hierarchical_path -> 'str'
propertysource_hierarchy_segments -> 'tuple[str, ...]'
propertysource_lib_reference -> 'str'
propertysource_unique_id -> 'str'
propertysource_unique_id_segments -> 'tuple[str, ...]'
methodto_record(self) -> 'dict[str, object]'Return a copy of the source component record.
class

AltiumPcbComponentBody

from altium_monkey import AltiumPcbComponentBody
class AltiumPcbComponentBody() -> 'None'

PCB component body primitive record.

Represents a 3D extruded shape for component mechanical representation. Extends Region with additional 3D properties.

Found in: - ComponentBodies6/Data (body definitions) - ShapeBasedComponentBodies6/Data (rendered bodies)

Attributes: layer: PCB layer (typically mechanical layers) is_locked: Is body locked is_keepout: Is keepout region net_index: Net index (uint16) polygon_index: Polygon index (uint16) component_index: Component index (uint16) hole_count: Number of holes/cutouts

Members (8)
KindSignatureSummary
propertycavity_height_mils -> 'float'Cavity height in mils.
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this component body.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
propertyoverall_height_mils -> 'float'Overall height in mils.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse ComponentBody record from binary data.
propertyrecord_type -> 'PcbRecordType'Return the PCB component-body record discriminator.
methodserialize_to_binary(self) -> 'bytes'Serialize ComponentBody record to binary format.
propertystandoff_height_mils -> 'float'Standoff height in mils.
class

AltiumPcbDifferentialPair

from altium_monkey import AltiumPcbDifferentialPair
class AltiumPcbDifferentialPair(name: 'str' = '', positive_net_name: 'str' = '', negative_net_name: 'str' = '', gather_control: 'bool' = False, unique_id: 'str' = '', layer: 'str' = 'TOP', selected: 'bool' = False, locked: 'bool' = False, polygon_outline: 'bool' = False, user_routed: 'bool' = True, keepout: 'bool' = False, union_index: 'int' = 0, _raw_record: 'dict[str, str]' = <factory>, _source_payload: 'bytes | None' = None) -> 'None'

PCB differential-pair object.

Altium stores these in `DifferentialPairs6/Data`. Pair classes live separately in `Classes6/Data` records with `KIND=6`, and routing constraints live separately in `Rules6/Data`.

Members (7)
KindSignatureSummary
classmethodcreate(cls, *, name: 'str', positive_net_name: 'str', negative_net_name: 'str', gather_control: 'bool' = False, unique_id: 'str | None' = None) -> "'AltiumPcbDifferentialPair'"Create a new differential-pair object from first principles.
classmethodfrom_record(cls, record: 'dict[str, str]', source: 'bytes | None' = None) -> "'AltiumPcbDifferentialPair'"Parse one `DifferentialPairs6/Data` text record.
propertynet_names -> 'tuple[str, str]'Return `(positive_net_name, negative_net_name)`.
methodresolve_negative_net(self, pcbdoc: "'AltiumPcbDoc'") -> 'AltiumPcbNet | None'Resolve the negative net name against a parsed `AltiumPcbDoc`.
methodresolve_positive_net(self, pcbdoc: "'AltiumPcbDoc'") -> 'AltiumPcbNet | None'Resolve the positive net name against a parsed `AltiumPcbDoc`.
methodto_record(self) -> 'dict[str, str]'Serialize to a `DifferentialPairs6/Data` text-record dictionary.
methoduses_net_name(self, net_name: 'str') -> 'bool'Return true when this pair references `net_name`.
class

AltiumPcbDoc

from altium_monkey import AltiumPcbDoc
class AltiumPcbDoc(filepath: 'Path | str | None' = None) -> 'None'

Altium PcbDoc file parser.

Parses complete PcbDoc files including both text-based component placement and binary primitive geometry (pads, tracks, arcs, texts).

Attributes: filepath: Path to .PcbDoc file

# Text-based data (Components6, Nets6, Board6, Classes6, Polygons6) components: List of AltiumPcbComponent (component placements) board: AltiumBoard (board origin and metadata) nets: List of AltiumPcbNet (net definitions with properties) net_classes: List of AltiumPcbNetClass (net class groupings) differential_pairs: List of AltiumPcbDifferentialPair records polygons: List of AltiumPcbPolygon (polygon pour definitions)

Members (100)
KindSignatureSummary
methodadd_arc(self, *, center_mils: 'PcbDocPointMils', radius_mils: 'float', start_angle_degrees: 'float', end_angle_degrees: 'float', width_mils: 'float', layer: 'PcbLayerLike' = 'Top Layer', net: 'str | AltiumPcbNet | None' = None, component_index: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None) -> 'AltiumPcbArc'Add a circular arc using mil units and degree angles.
methodadd_component(self, *, designator: 'str', footprint: 'str', position_mils: 'PcbDocPointMils', layer: 'str | PcbLayer | int' = 'TOP', rotation_degrees: 'float' = 0.0, source_footprint_library: 'str | Path' = '', name_on: 'bool' = True, comment_on: 'bool' = False, name_auto_position: 'PcbTextAutoposition | None' = None, comment_auto_position: 'PcbTextAutoposition | None' = None, description: 'str' = '', parameters: 'dict[str, str] | None' = None, unique_id: 'str | None' = None, channel_offset: 'int | None' = None, source_designator: 'str | None' = None, source_unique_id: 'str' = '', source_hierarchical_path: 'str' = '', source_component_library: 'str' = '', source_component_library_identifier_kind: 'PcbLibIdentifierKind | None' = None, source_component_library_identifier: 'str' = '', source_lib_reference: 'str' = '', footprint_description: 'str' = '', lock_strings: 'bool | None' = None, enable_pin_swapping: 'bool | None' = None, enable_part_swapping: 'bool | None' = None, jumpers_visible: 'bool | None' = True, guid: 'uuid.UUID | None' = None, locked: 'bool' = False) -> 'AltiumPcbComponent'Add a component placement record without placing footprint primitives.
methodadd_component_body(self, *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike' = <PcbLayer.MECHANICAL_1: 57>, overall_height_mils: 'float', standoff_height_mils: 'float' = 0.5, cavity_height_mils: 'float' = 0.0, body_projection: 'PcbBodyProjection' = <PcbBodyProjection.TOP: 0>, model: 'AltiumPcbModel | None' = None, model_2d_mils: 'PcbDocPointMils' = (0.0, 0.0), model_2d_rotation_degrees: 'float' = 0.0, model_3d_rotx_degrees: 'float | None' = None, model_3d_roty_degrees: 'float | None' = None, model_3d_rotz_degrees: 'float | None' = None, model_3d_dz_mils: 'float | None' = None, model_checksum: 'int | None' = None, identifier: 'str | None' = None, name: 'str' = ' ', body_color_3d: 'int' = 8421504, body_opacity_3d: 'float' = 1.0, model_type: 'int' = 1, model_source: 'str | None' = None, guid: 'uuid.UUID | None' = None) -> 'AltiumPcbComponentBody'Add a free board-level 3D component body using mil-unit geometry.
methodadd_component_body_rectangle(self, *, left_mils: 'float', bottom_mils: 'float', right_mils: 'float', top_mils: 'float', **kwargs: 'Unpack[_ComponentBodyRectangleKwargs]') -> 'AltiumPcbComponentBody'Add a rectangular free 3D component body using mil-unit bounds.
methodadd_component_from_pcblib(self, footprint: 'object', *, designator: 'str', position_mils: 'PcbDocPointMils', layer: 'str | PcbLayer | int' = 'TOP', rotation_degrees: 'float' = 0.0, source_footprint_library: 'str | Path' = '', comment_text: 'str | None' = None, comment_visible: 'bool' = False, component_parameters: 'dict[str, str] | None' = None, pad_nets: 'dict[str, str] | None' = None, source_pcblib: 'object | None' = None) -> 'AltiumPcbComponent'Place a PcbLib footprint and return the live component record.
methodadd_component_pad_mask_shape(self, component_index: 'int', designator: 'str', *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike', occurrence: 'int' = 0, hole_points_mils: 'list[list[tuple[float, float]]] | None' = None, outline_vertices: 'Sequence[PcbExtendedVertex] | None' = None, slot: 'PcbPadMaskShapeSlot | None' = None) -> 'AltiumPcbRegion'Give a placed component's pad its own shape on a paste or solder mask
methodadd_custom_pad(self, *, designator: 'str', position_mils: 'PcbDocPointMils', outline_points_mils: 'Sequence[PcbDocPointMils]', layer: 'int | PcbLayer' = <PcbLayer.TOP: 1>, offset_mils: 'PcbDocPointMils' = (0.0, 0.0), anchor_diameter_mils: 'float' = 1.0, anchor_width_mils: 'float | None' = None, anchor_height_mils: 'float | None' = None, anchor_rotation_degrees: 'float' = 0.0, anchor_shape: 'int | str | PadShape' = <PadShape.CIRCLE: 1>, pad_index: 'int | None' = None, hole_points_mils: 'Sequence[Sequence[PcbDocPointMils]] | None' = None, outline_vertices: 'Sequence[PcbExtendedVertex] | None' = None, outline_points_are_local: 'bool' = True, layer_shapes: "Sequence['PcbCustomPadLayerShapeSpec'] | None" = None, net: 'str | AltiumPcbNet | None' = None, hole_size_mils: 'float' = 0.0, plated: 'bool | None' = None, slot_length_mils: 'float' = 0.0, slot_rotation_degrees: 'float' = 0.0, hole_shape: 'int | str | PadHoleShape' = <PadHoleShape.ROUND: 0>, hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, solder_mask_expansion: 'PcbMaskExpansionInput' = None, solder_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, paste_mask_expansion_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None, body_guid: 'uuid.UUID | None' = None, anchor_layer: 'int | PcbLayer | None' = None) -> 'AltiumPcbPad'Add a board custom pad using an anchor pad and custom outline region.
methodadd_differential_pair(self, *, name: 'str', positive_net_name: 'str', negative_net_name: 'str', gather_control: 'bool' = False, create_missing_nets: 'bool' = True, unique_id: 'str | None' = None) -> 'AltiumPcbDifferentialPair'Add or update a PCB differential-pair object.
methodadd_dimension_record(self, *, record_type: 'int', record_payload: 'bytes | bytearray | memoryview', record_leader: 'int' = 0) -> 'AltiumPcbDimension'Add a raw Dimensions6 record to the authored PcbDoc.
methodadd_embedded_3d_model(self, model: 'AltiumPcbModel', *, overall_height_mils: 'float | None' = None, bounds_mils: 'PcbDocBoundsMils | None' = None, projection_outline_mils: 'Sequence[PcbDocPointMils] | None' = None, layer: 'PcbLayerLike' = <PcbLayer.MECHANICAL_1: 57>, side: 'PcbBodyProjection' = <PcbBodyProjection.TOP: 0>, location_mils: 'PcbDocPointMils' = (0.0, 0.0), rotation_x_degrees: 'float | None' = None, rotation_y_degrees: 'float | None' = None, rotation_z_degrees: 'float | None' = None, standoff_height_mils: 'float | None' = None, identifier: 'str | None' = None, name: 'str' = ' ', opacity: 'float' = 1.0) -> 'AltiumPcbComponentBody'Place an embedded PCB 3D model using Altium 3D Body dialog concepts.
methodadd_embedded_board_array(self, child: 'AltiumPcbDoc | Path | str | None', *, position_mils: 'PcbDocPointMils', document_path: 'str | None' = None, rotation_degrees: 'float' = 0.0, mirror: 'bool' = False, rows: 'int' = 1, columns: 'int' = 1, row_pitch_mils: 'float' = 0.0, column_pitch_mils: 'float' = 0.0, origin_mode: 'PcbEmbeddedBoardOriginMode | int' = <PcbEmbeddedBoardOriginMode.BOTTOM_LEFT: 1>, layer: 'PcbLayerLike' = <PcbLayer.TOP: 1>, untransmitted_layers: 'Sequence[PcbLayerLike]' = (), transmit_drill_table: 'bool' = True, transmit_board_shape: 'bool' = True, transmit_dimensions: 'bool' = True, transmit_layer_stack_table: 'bool' = True) -> 'PcbEmbeddedBoardSource'Add an embedded board array placing copies of a child PcbDoc.
methodadd_embedded_model(self, *, name: 'str', model_data: 'bytes', model_id: 'str | None' = None, rotation_x_degrees: 'float' = 0.0, rotation_y_degrees: 'float' = 0.0, rotation_z_degrees: 'float' = 0.0, z_offset_mils: 'float' = 0.0, checksum: 'int | None' = None, model_source: 'str' = 'Undefined', data_is_compressed: 'bool' = False) -> 'AltiumPcbModel'Add an embedded 3D model payload to this board.
methodadd_extruded_3d_body(self, *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike' = <PcbLayer.MECHANICAL_1: 57>, overall_height_mils: 'float', standoff_height_mils: 'float' = 0.0, side: 'PcbBodyProjection' = <PcbBodyProjection.TOP: 0>, name: 'str' = 'Extruded 3D Body', identifier: 'str | None' = None, body_color_3d: 'int' = 8421504, opacity: 'float' = 1.0) -> 'AltiumPcbComponentBody'Add a free generic extruded 3D body to this board.
methodadd_fill(self, corner1_mils: 'PcbDocPointMils', corner2_mils: 'PcbDocPointMils', *, rotation_degrees: 'float' = 0.0, layer: 'PcbLayerLike' = 'Top Layer', net: 'str | AltiumPcbNet | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None) -> 'AltiumPcbFill'Add a rectangular fill using opposite mil-unit corners.
methodadd_mask_record(self, primitive_object_id: 'str', index: 'int', *, solder_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None) -> 'None'Save one authored primitive's own solder- and paste-mask modes.
methodadd_net(self, name: 'str', *, preferred_width_mils: 'float' = 10.0, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None) -> 'AltiumPcbNet'Add or return a net by name.
methodadd_pad(self, *, designator: 'str', position_mils: 'PcbDocPointMils', width_mils: 'float', height_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP: 1>, shape: 'int | str | PadShape' = <PadShape.RECTANGLE: 2>, rotation_degrees: 'float' = 0.0, hole_size_mils: 'float' = 0.0, plated: 'bool | None' = None, net: 'str | AltiumPcbNet | None' = None, corner_radius_percent: 'int | float | None' = None, top_shape: 'int | str | PadShape | None' = None, top_width_mils: 'float | None' = None, top_height_mils: 'float | None' = None, mid_shape: 'int | str | PadShape | None' = None, mid_width_mils: 'float | None' = None, mid_height_mils: 'float | None' = None, bottom_shape: 'int | str | PadShape | None' = None, bottom_width_mils: 'float | None' = None, bottom_height_mils: 'float | None' = None, pad_mode: 'int | None' = None, slot_length_mils: 'float' = 0.0, slot_rotation_degrees: 'float' = 0.0, hole_shape: 'int | str | PadHoleShape' = <PadHoleShape.ROUND: 0>, solder_mask_expansion: 'PcbMaskExpansionInput' = None, solder_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, paste_mask_expansion_mils: 'float | None' = None, hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, is_test_fab_top: 'bool' = False, is_test_fab_bottom: 'bool' = False, is_assy_testpoint_top: 'bool' = False, is_assy_testpoint_bottom: 'bool' = False, solder_mask_expansion_bottom_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None, is_locked: 'bool' = False) -> 'AltiumPcbPad'Add a pad using mil-unit center and size.
methodadd_region(self, *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike' = <PcbLayer.TOP: 1>, hole_points_mils: 'list[list[tuple[float, float]]] | None' = None, outline_vertices: 'Sequence[PcbExtendedVertex] | None' = None, kind: 'int | PcbRegionKind' = <PcbRegionKind.COPPER: 0>, is_board_cutout: 'bool' = False, is_shapebased: 'bool' = False, is_keepout: 'bool' = False, keepout_restrictions: 'int' = 0, subpoly_index: 'int' = -1, net: 'str | AltiumPcbNet | None' = None, component_index: 'int | None' = None, cavity_height_mils: 'float' = 0.0, v7_layer: 'str | None' = None, guid: 'uuid.UUID | None' = None) -> 'AltiumPcbRegion'Add a region polygon using mil-unit vertices.
methodadd_text(self, *, text: 'str', position_mils: 'PcbDocPointMils', height_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP_OVERLAY: 33>, rotation_degrees: 'float' = 0.0, stroke_width_mils: 'float' = 10.0, font_kind: 'str | PcbTextKind' = <PcbTextKind.STROKE: 'stroke'>, stroke_font_type: 'int | str' = 'default', font_name: 'str' = 'Arial', bold: 'bool' = False, italic: 'bool' = False, is_comment: 'bool' = False, is_designator: 'bool' = False, is_mirrored: 'bool' = False, is_inverted: 'bool' = False, inverted_margin_mils: 'float' = 0.0, use_inverted_rectangle: 'bool' = False, inverted_rectangle_size_mils: 'tuple[float, float] | None' = None, is_frame: 'bool' = False, frame_size_mils: 'tuple[float, float] | None' = None, text_justification: 'int | PcbTextJustification | None' = None, barcode_kind: 'int | PcbBarcodeKind' = <PcbBarcodeKind.CODE_39: 0>, barcode_render_mode: 'int | PcbBarcodeRenderMode' = <PcbBarcodeRenderMode.BY_FULL_WIDTH: 1>, barcode_full_size_mils: 'tuple[float, float] | None' = None, barcode_margin_mils: 'tuple[float, float]' = (20.0, 20.0), barcode_min_width_mils: 'float' = 0.0, barcode_show_text: 'bool' = True, barcode_inverted: 'bool' = True, component_index: 'int | None' = None, guid: 'uuid.UUID | None' = None) -> 'AltiumPcbText'Add PCB text using mil units.
methodadd_track(self, start_mils: 'PcbDocPointMils', end_mils: 'PcbDocPointMils', *, width_mils: 'float', layer: 'PcbLayerLike' = 'Top Layer', net: 'str | AltiumPcbNet | None' = None, component_index: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None) -> 'AltiumPcbTrack'Add a track segment using mil-unit endpoints and width.
methodadd_user_union_member(self, union_index: 'int', member: 'object') -> 'PcbUserUnion'Add one primitive, member reference, or component to a user union.
methodadd_via(self, *, position_mils: 'PcbDocPointMils', diameter_mils: 'float', hole_size_mils: 'float', layer_start: 'PcbLayerLike' = <PcbLayer.TOP: 1>, layer_end: 'PcbLayerLike' = <PcbLayer.BOTTOM: 32>, net: 'str | AltiumPcbNet | None' = None, ipc4761_via_type: 'int | PcbIpc4761ViaType' = <PcbIpc4761ViaType.NONE: 0>, ipc4761_features: 'Sequence[AltiumPcbViaStructureFeature] | None' = None, propagation_delay_ps: 'float | None' = None, hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, is_tent_top: 'bool' = False, is_tent_bottom: 'bool' = False, solder_mask_expansion_top_mils: 'float | None' = None, solder_mask_expansion_bottom_mils: 'float | None' = None, solder_mask_expansion: 'PcbMaskExpansionInput' = None, is_test_fab_top: 'bool' = False, is_test_fab_bottom: 'bool' = False, is_assy_testpoint_top: 'bool' = False, is_assy_testpoint_bottom: 'bool' = False, guid: 'uuid.UUID | None' = None, is_locked: 'bool' = False, removed_copper_lands: 'Sequence[PcbLayerLike]' = (), drill_layer_pair_type: 'int | PcbDrillPairKind' = <PcbDrillPairKind.REGULAR: 0>, tents_by_rule: 'bool' = True) -> 'AltiumPcbVia'Add a via using mil-unit center, diameter, and hole size.
methodadd_via_shielding_union(self, *, name: 'str', options: 'PcbViaShieldingOptions', template_via: 'AltiumPcbVia', member_positions_mils: 'Sequence[PcbDocPointMils]', union_index: 'int | None' = None) -> 'PcbViaShieldingUnion'Add a via-shielding SmartUnion with its member vias, as Altium saves one.
methodadd_via_stitching_union(self, *, name: 'str', options: 'PcbViaStitchingOptions', template_via: 'AltiumPcbVia', member_positions_mils: 'Sequence[PcbDocPointMils]', area_points_mils: 'Sequence[PcbDocPointMils]', constrain_area: 'bool' = True, union_index: 'int | None' = None) -> 'PcbViaStitchingUnion'Add a via-stitching SmartUnion with its member vias, as Altium saves one.
methodasset_inventory(self, *, include_hashes: 'bool' = False) -> 'AltiumAssetInventory'Return extractable asset inventory for this PcbDoc.
methodboard_region_source_presence(self) -> "Literal['absent', 'empty', 'present', 'unresolved']"Read current BoardRegions presence without serializing or reopening.
methodboard_stack_declaration_evidence(self) -> 'PcbBoardStackSourceEvidence'Read original Board6 declaration observations and their current binding.
methodcomponent_body_companion_index(self, ordinary_index: 'int') -> 'int | None'Return the current analytic collection index for an unchanged Source body.
methodcompute_board_centroid_mils(self) -> 'tuple[float, float] | None'Compute a stable board centroid in mils from board-outline geometry.
methodcompute_board_centroid_relative_to_origin_mils(self) -> 'tuple[float, float] | None'Compute board centroid offset from board datum/origin in mils.
methodcreate_user_union(self, name: 'str', members: 'Sequence[object]' = (), *, union_index: 'int | None' = None) -> 'PcbUserUnion'Create a named user-defined PCB union and optionally assign members.
methodcustom_pads_without_body(self) -> 'tuple[int, ...]'Return the Pads6 indices of the custom pads that save no body:
methoddelete_user_union(self, union_index: 'int') -> 'None'Delete a user-defined PCB union and clear its parsed member fields.
propertydifferential_pair_classes -> 'list[AltiumPcbNetClass]'Return `Classes6/Data` object classes whose members are pair names.
propertydifferential_pairs_by_net_name -> 'dict[str, AltiumPcbDifferentialPair]'Map each referenced net name to its differential-pair object.
methodembedded_asset_inventory(self, *, include_hashes: 'bool' = False) -> 'EmbeddedAssetInventory'Return an aggregate read-only inventory for embedded PCB assets.
methodembedded_font_payloads(self) -> 'tuple[bytes, ...]'Return decompressed embedded font payloads in summary order.
methodembedded_font_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbFontSummary, ...]'Return read-only embedded TrueType font inventory summaries.
propertyembedded_fonts_end -> 'EmbeddedFontsEnd | None'Where Altium stops loading the board's embedded fonts
methodembedded_model_payloads(self) -> 'tuple[bytes, ...]'Return decompressed embedded model payloads in summary order.
methodembedded_model_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbModelSummary, ...]'Return read-only embedded 3D model inventory summaries.
methodextract_asset(self, ref: 'AltiumAssetRef') -> 'AltiumExtractedAsset'Extract one asset selected from `asset_inventory()`.
methodextract_embedded_fonts(self, output_dir: 'Path', verbose: 'bool' = False) -> 'list[Path]'Extract embedded PCB TrueType fonts to `output_dir`.
methodextract_embedded_models(self, output_dir: 'Path', verbose: 'bool' = False) -> 'list[Path]'Extract embedded 3D model payloads to `output_dir`.
methodextract_footprint(self, ref_or_name_or_index: 'object', *, verbose: 'bool' = False) -> 'AltiumPcbLib'Extract one PcbDoc footprint as a single-footprint PcbLib.
methodextract_pcblib(self, output_path: 'Path | None' = None, verbose: 'bool' = False) -> 'AltiumPcbLib'Extract footprints from PcbDoc as an AltiumPcbLib object.
methodfab(self, **options: 'Unpack[ContextOptions]') -> 'Fab'This board's Fab outputs and views, with its inputs fixed.
propertyfile_version_info -> 'FileVersionInfo'The `FileVersionInfo/Data` stream: the format changes the Altium that
classmethodfrom_bytes(cls, data: 'bytes', filename: 'Path | str | None' = 'embedded.PcbDoc', verbose: 'bool' = False, parse_geometry: 'bool' = True) -> 'AltiumPcbDoc'Parse a PcbDoc from OLE bytes.
classmethodfrom_file(cls, filepath: 'Path', verbose: 'bool' = False, parse_geometry: 'bool' = True) -> 'AltiumPcbDoc'Parse a PcbDoc file.
methodget_component_origin_mils(self, component_index: 'int', *, origin_relative: 'bool' = True) -> 'tuple[float, float]'Return the PcbDoc component placement origin in mils.
methodget_component_pick_place_center_mils(self, component_index: 'int', *, origin_relative: 'bool' = True) -> 'tuple[float, float]'Return Altium-style pick-and-place center coordinates for a component.
methodget_component_pnp_position_mils(self, component_index: 'int', *, position_mode: 'PnpPositionMode | str' = 'altium-pick-place', origin_relative: 'bool' = True) -> 'tuple[float, float]'Return a component PnP position in mils for the selected public mode.
methodget_component_primitives(self, component_index: 'int') -> 'dict[str, list]'Get all primitives belonging to a component by index.
methodget_components_by_footprint(self, footprint: 'str') -> 'list[AltiumPcbComponent]'Get all components using a specific footprint.
methodget_differential_pair(self, name: 'str') -> 'AltiumPcbDifferentialPair | None'Return a differential pair by name, case-insensitively.
methodget_embedded_font_payload(self, index: 'int') -> 'bytes'Return one decompressed embedded font payload by inventory index.
methodget_embedded_model_entries(self) -> 'list[tuple[AltiumPcbModel, bytes]]'Return embedded model metadata plus compressed payload bytes.
methodget_embedded_model_payload(self, index: 'int') -> 'bytes'Return one decompressed embedded model payload by inventory index.
methodget_mechanical_layer_kind(self, layer: 'int | str | PcbLayer') -> 'MechanicalLayerKind | None'Return the semantic kind assigned to a mechanical layer, if present.
methodget_net_primitives(self, net_index: 'int') -> 'dict[str, list]'Get all primitives assigned to a net by index.
methodget_unique_footprints(self) -> 'set[str]'Get unique footprint names used in the design.
methodlayers(self) -> 'PcbLayerContext'Return this board's one layer context.
methodmark_modified(self) -> 'None'Record that this document's source records changed.
methodpad_mask_shape(self, pad_index: 'int', layer: 'PcbMaskShapeLayer') -> 'PcbMaskLayerShape | None'The shape the pad at ``pad_index`` in ``pads`` keeps on mask
methodplace_component(self, footprint: 'AltiumPcbFootprint', *, designator: 'str', position_mils: 'PcbDocPointMils', layer: 'str | PcbLayer | int' = 'TOP', rotation_degrees: 'float' = 0.0, source_footprint_library: 'str | Path' = '', comment_text: 'str | None' = None, comment_visible: 'bool' = False, component_parameters: 'dict[str, str] | None' = None, source_pcblib: 'AltiumPcbLib | None' = None, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None, pads: 'Sequence[PcbPadOccurrence | None]' = (), members: 'Sequence[PcbMemberOccurrence]' = (), pad_nets: 'Mapping[str, AltiumPcbNet | str] | None' = None, locked_vias: 'Sequence[int]' = ()) -> 'PcbPlacedComponent'Place a PcbLib footprint, each member with its own net and identity.
methodprimitive_guid(self, record: 'object') -> 'uuid.UUID | None'The `PrimitiveGuids` GUID this board saves for `record`, a net (type
methodremove_mechanical_layer_pairs_for(self, layers: 'Collection[int | str | PcbLayer]') -> 'None'Remove all ``MECHPAIR*`` records referencing any layer in ``layers`` and compact indices.
methodremove_text(self, text: 'AltiumPcbText') -> 'None'Remove one Text record, and its full string from `WideStrings6`.
methodremove_user_union_member(self, union_index: 'int', member: 'object') -> 'PcbUserUnion'Remove one primitive, member reference, or component from a user union.
methodrename_user_union(self, union_index: 'int', name: 'str') -> 'PcbUserUnion'Rename an existing user-defined PCB union.
methodreplace_via_pattern_union(self, union: 'PcbViaStitchingUnion | PcbViaShieldingUnion') -> 'None'Replace one via-stitching or via-shielding SmartUnion with `union`.
methodrouting_context_parse_failures(self) -> 'tuple[PcbRoutingContextParseFailure, ...]'Read original tolerated Nets/Classes/DifferentialPairs/Rules failures.
methodsave(self, filepath: 'Path | str', verbose: 'bool' = False) -> 'None'Save to binary PcbDoc format.
methodsection_read_failures(self) -> 'tuple[tuple[str, str], ...]'Sections whose read failed on open, each with the reason.
methodset_board_outline(self, outline: 'AltiumBoardOutline') -> 'None'Replace the board outline with line/arc outline geometry in mils.
methodset_layer_stack_document(self, document: 'AltiumLayerStackDocument') -> 'None'Apply a typed layer-stack document to this board.
methodset_layer_stack_template(self, template: 'object') -> 'None'Apply a named or explicit layer-stack template to this board.
methodset_mechanical_layer(self, layer: 'int | str | PcbLayer', *, name: 'str | None' = None, enabled: 'bool' = True, used_by_prims: 'bool | None' = None) -> 'None'Set a mechanical layer display name and enabled state.
methodset_mechanical_layer_kind(self, layer: 'int | str | PcbLayer', kind: 'int | str | MechanicalLayerKind') -> 'None'Set the semantic kind assigned to a mechanical layer.
methodset_mechanical_layer_pair(self, layer_1: 'int | str | PcbLayer', layer_2: 'int | str | PcbLayer', *, pair_index: 'int | None' = None) -> 'None'Define a mechanical mirror pair used by component side flipping.
methodset_origin_mils(self, x_mils: 'float', y_mils: 'float') -> 'None'Set the board origin in mils.
methodset_origin_to_outline_lower_left(self) -> 'None'Set the board origin to the lower-left bounds of the current outline.
methodset_outline_circle_mils(self, *, center_mils: 'PcbDocPointMils', diameter_mils: 'float', vertex_count: 'int' = 64) -> 'None'Approximate a circular board outline with a polygon in mils.
methodset_outline_rectangle_mils(self, left_mils: 'float', bottom_mils: 'float', right_mils: 'float', top_mils: 'float') -> 'None'Set the board outline to an axis-aligned rectangle in mils.
methodset_outline_vertices_mils(self, vertices_mils: 'Sequence[tuple[float, float]]') -> 'None'Replace the board outline with explicit polygon vertices in mils.
methodto_bom(self, **options: 'Unpack[BoardBomOptions]') -> 'FabOutput'This board's PCB BOM as Altium writes it from the PcbDoc, in memory,
methodto_gerbers(self, **options: 'Unpack[BoardGerberOptions]') -> 'FabOutput'This board's Gerber files, in memory, in one call.
methodto_ipc2581(self, **options: 'Unpack[BoardIpc2581Options]') -> 'FabOutput'This board's IPC-2581B document, in memory, in one call.
methodto_layer_svgs(self, **options: 'Unpack[BoardSvgOptions]') -> 'FabOutput'This board as one SVG image per layer key, in memory, in one call.
methodto_nc_drill(self, **options: 'Unpack[BoardNcDrillOptions]') -> 'FabOutput'This board's NC drill set, in memory, in one call.
methodto_pnp(self, **options: 'Unpack[BoardPnpOptions]') -> 'FabOutput'This board's Pick and Place file as Altium writes it, in memory, in
methodto_svg(self, **options: 'Unpack[BoardSvgOptions]') -> 'FabOutput'This board as one SVG image, in memory, in one call.
methodtranslate_region(self, index: 'int', *, dx_mils: 'float', dy_mils: 'float') -> 'None'Translate one retained placed copper Region and its same-GUID companion.
methodunlinked_custom_pad_bodies(self) -> 'tuple[PcbUnlinkedCustomPadBody, ...]'Return the Region and ShapeBasedRegion records whose saved PADINDEX
methodunreadable_streams(self) -> 'tuple[tuple[str, str], ...]'Streams whose sector chain could not be followed to its end.
propertyuser_unions -> 'tuple[PcbUserUnion, ...]'Return read-only semantic views of named user-defined PCB unions.
propertyvia_shielding_unions -> 'tuple[PcbViaShieldingUnion, ...]'Typed via-shielding SmartUnions, in SmartUnions/Data order.
propertyvia_stitching_unions -> 'tuple[PcbViaStitchingUnion, ...]'Typed via-stitching SmartUnions, in SmartUnions/Data order.
methodwritten_index(self, record: 'object') -> 'int'Where one of this board's records is written in its stream: its
class

AltiumPcbEmbeddedBoard

from altium_monkey.altium_pcb_embedded_board import AltiumPcbEmbeddedBoard
class AltiumPcbEmbeddedBoard(document_path: 'str', layer: 'str', x: 'str', y: 'str', x1: 'str', y1: 'str', x2: 'str', y2: 'str', rotation: 'str', mirror: 'str', row_count: 'str', column_count: 'str', row_spacing: 'str', column_spacing: 'str', origin_mode: 'str', raw_fields: 'tuple[tuple[str, str], ...]', payload: 'bytes' = b'', read_payload: 'bytes | None' = None, stored: 'bool' = True) -> 'None'

One immutable EmbeddedBoards6/Data source record.

The text fields hold the value Altium reads for each property, the first one when a key repeats, matched without case. `raw_fields` keeps those pairs in record order and `payload` the record's exact stored bytes. `read_payload` is the record whose values Altium reads when it is not this one: the previous record's for a zero-length record, Altium's default board for a board the Header counts and Data does not hold. `stored` is False for such a default board, which has no stored bytes.

Members (1)
KindSignatureSummary
classmethodfrom_fields(cls, fields: 'tuple[tuple[str, str], ...]', payload: 'bytes' = b'', read_payload: 'bytes | None' = None, stored: 'bool' = True) -> 'AltiumPcbEmbeddedBoard'Create a record view without interpreting placement semantics.
class

AltiumPcbFill

from altium_monkey import AltiumPcbFill
class AltiumPcbFill() -> 'None'

PCB fill primitive record.

Represents a filled rectangle on PCB (copper fill, silkscreen fill).

Attributes: pos1_x: First corner X position (internal units, 10k/mil) pos1_y: First corner Y position (internal units) pos2_x: Opposite corner X position (internal units) pos2_y: Opposite corner Y position (internal units) rotation: Rotation angle (degrees, around center) layer: Layer number (1=TOP, 32=BOTTOM, etc.) component_index: Links to component (uint16, PCB_UNLINKED_INDEX when unlinked) net_index: Links to net (uint16, PCB_UNLINKED_INDEX when unlinked) polygon_index: Polygon index (uint16, always PCB_UNLINKED_INDEX for fills) union_index: Union membership (uint32, 0xFFFFFFFF=none) is_locked: Locked for editing is_keepout: Keepout fill region is_polygon_outline: Part of polygon outline (always False for fills) user_routed: True if manually routed (flags1 bit 3) solder_mask_expansion: Solder mask expansion value (int32, internal units) paste_mask_expansion: Paste mask expansion value (uint8, always 0 in practice) v7_layer_id: V7 layer identifier field (uint32) keepout_restrictions: Keepout bitmask. Use `altium_pcb_keepout` helpers for the SDK-confirmed bit names.

Members (13)
KindSignatureSummary
propertycenter_x -> 'int'Get center X in internal units.
propertycenter_y -> 'int'Get center Y in internal units.
propertyheight_internal -> 'int'Get height in internal units.
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this fill.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse FILL record from binary data.
propertypos1_x_mils -> 'float'Get position 1 X in mils.
propertypos1_y_mils -> 'float'Get position 1 Y in mils.
propertypos2_x_mils -> 'float'Get position 2 X in mils.
propertypos2_y_mils -> 'float'Get position 2 Y in mils.
propertyrecord_type -> 'PcbRecordType'Return the PCB fill record discriminator.
methodserialize_to_binary(self) -> 'bytes'Serialize FILL record to binary format.
propertywidth_internal -> 'int'Get width in internal units.
class

AltiumPcbFootprint

from altium_monkey import AltiumPcbFootprint
class AltiumPcbFootprint(name: 'str' = '') -> 'None'

Single footprint within a PcbLib file.

Contains all primitive types: pads, tracks, arcs, fills, text, vias, regions, and component bodies. Each primitive uses the same OOP record class as PcbDoc (e.g. AltiumPcbPad, AltiumPcbTrack).

Members (27)
KindSignatureSummary
methodadd_arc(self, *, center_mils: 'PcbPointMils', radius_mils: 'float', start_angle_degrees: 'float', end_angle_degrees: 'float', width_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP_OVERLAY: 33>, v7_layer_id: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None) -> 'AltiumPcbArc'Add a circular arc to this footprint using mil units and degree angles.
methodadd_component_body(self, *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike' = <PcbLayer.MECHANICAL_1: 57>, overall_height_mils: 'float', standoff_height_mils: 'float' = 0.5, cavity_height_mils: 'float' = 0.0, body_projection: 'PcbBodyProjection' = <PcbBodyProjection.TOP: 0>, model: 'AltiumPcbModel | None' = None, model_2d_mils: 'PcbPointMils' = (0.0, 0.0), model_2d_rotation_degrees: 'float' = 0.0, model_3d_rotx_degrees: 'float | None' = None, model_3d_roty_degrees: 'float | None' = None, model_3d_rotz_degrees: 'float | None' = None, model_3d_dz_mils: 'float | None' = None, model_checksum: 'int | None' = None, identifier: 'str | None' = None, name: 'str' = ' ', body_color_3d: 'int' = 8421504, body_opacity_3d: 'float' = 1.0, model_type: 'int' = 1, model_source: 'str | None' = None) -> 'AltiumPcbComponentBody'Add a component body outline using mil-unit vertices.
methodadd_component_body_rectangle(self, *, left_mils: 'float', bottom_mils: 'float', right_mils: 'float', top_mils: 'float', **kwargs: 'object') -> 'AltiumPcbComponentBody'Add a rectangular component body using mil-unit bounds.
methodadd_custom_pad(self, *, designator: 'str', position_mils: 'PcbPointMils', outline_points_mils: 'list[tuple[float, float]]', layer: 'int | PcbLayer' = <PcbLayer.TOP: 1>, offset_mils: 'PcbPointMils' = (0.0, 0.0), anchor_diameter_mils: 'float' = 1.0, anchor_width_mils: 'float | None' = None, anchor_height_mils: 'float | None' = None, anchor_rotation_degrees: 'float' = 0.0, anchor_shape: 'int | str | PadShape' = <PadShape.CIRCLE: 1>, pad_index: 'int | None' = None, hole_points_mils: 'list[list[tuple[float, float]]] | None' = None, outline_points_are_local: 'bool' = True, paste_rule_expansion: 'bool | None' = None, solder_rule_expansion: 'bool | None' = None, solder_mask_expansion: 'PcbMaskExpansionInput' = None, solder_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, paste_mask_expansion_mils: 'float | None' = None) -> 'AltiumPcbPad'Add a custom pad using mil units and local or absolute polygon points.
methodadd_embedded_3d_model(self, model: 'AltiumPcbModel', *, overall_height_mils: 'float | None' = None, bounds_mils: 'PcbBoundsMils | None' = None, projection_outline_mils: 'Sequence[PcbPointMils] | None' = None, layer: 'PcbLayerLike' = <PcbLayer.MECHANICAL_1: 57>, side: 'PcbBodyProjection' = <PcbBodyProjection.TOP: 0>, location_mils: 'PcbPointMils' = (0.0, 0.0), rotation_x_degrees: 'float | None' = None, rotation_y_degrees: 'float | None' = None, rotation_z_degrees: 'float | None' = None, standoff_height_mils: 'float | None' = None, identifier: 'str | None' = None, name: 'str' = ' ', opacity: 'float' = 1.0) -> 'AltiumPcbComponentBody'Place an embedded PCB 3D model using Altium 3D Body dialog concepts.
methodadd_extruded_3d_body(self, *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike' = <PcbLayer.MECHANICAL_1: 57>, overall_height_mils: 'float', standoff_height_mils: 'float' = 0.0, side: 'PcbBodyProjection' = <PcbBodyProjection.TOP: 0>, name: 'str' = 'Extruded 3D Body', identifier: 'str | None' = None, body_color_3d: 'int' = 8421504, opacity: 'float' = 1.0) -> 'AltiumPcbComponentBody'Add a generic extruded 3D body to this footprint.
methodadd_fill(self, corner1_mils: 'PcbPointMils', corner2_mils: 'PcbPointMils', *, layer: 'PcbLayerLike' = <PcbLayer.TOP_OVERLAY: 33>, rotation_degrees: 'float' = 0.0, v7_layer_id: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None) -> 'AltiumPcbFill'Add a rectangular fill to this footprint using opposite mil corners.
methodadd_mask_record(self, primitive: 'AltiumPcbTrack | AltiumPcbArc | AltiumPcbFill | AltiumPcbRegion', *, solder_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None) -> 'AltiumPcbExtendedPrimitiveInformation'Save one of this footprint's primitives' own solder- and paste-mask modes.
methodadd_pad(self, *, designator: 'str', position_mils: 'PcbPointMils', width_mils: 'float', height_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP: 1>, shape: 'int | str | PadShape' = <PadShape.RECTANGLE: 2>, rotation_degrees: 'float' = 0.0, hole_size_mils: 'float' = 0.0, plated: 'bool | None' = None, corner_radius_percent: 'int | float | None' = None, top_shape: 'int | str | PadShape | None' = None, top_width_mils: 'float | None' = None, top_height_mils: 'float | None' = None, mid_shape: 'int | str | PadShape | None' = None, mid_width_mils: 'float | None' = None, mid_height_mils: 'float | None' = None, bottom_shape: 'int | str | PadShape | None' = None, bottom_width_mils: 'float | None' = None, bottom_height_mils: 'float | None' = None, pad_mode: 'int | None' = None, slot_length_mils: 'float' = 0.0, slot_rotation_degrees: 'float' = 0.0, hole_shape: 'int | str | PadHoleShape' = <PadHoleShape.ROUND: 0>, solder_mask_expansion: 'PcbMaskExpansionInput' = None, solder_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, paste_mask_expansion_mils: 'float | None' = None, hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, is_test_fab_top: 'bool' = False, is_test_fab_bottom: 'bool' = False, is_assy_testpoint_top: 'bool' = False, is_assy_testpoint_bottom: 'bool' = False, solder_mask_expansion_bottom_mils: 'float | None' = None) -> 'AltiumPcbPad'Add a pad to this footprint using public mil units.
methodadd_region(self, *, outline_points_mils: 'Sequence[PcbRegionOutlinePoint]', layer: 'PcbLayerLike' = <PcbLayer.TOP: 1>, hole_points_mils: 'Sequence[Sequence[PcbRegionOutlinePoint]] | None' = None, kind: 'int | PcbRegionKind' = <PcbRegionKind.COPPER: 0>, is_board_cutout: 'bool' = False, is_shapebased: 'bool' = False, is_keepout: 'bool' = False, keepout_restrictions: 'int' = 0, subpoly_index: 'int | None' = None, cavity_height_mils: 'float' = 0.0, v7_layer: 'str | None' = None) -> 'AltiumPcbRegion'Add a region to this footprint using mil-unit vertices.
methodadd_text(self, *, text: 'str', position_mils: 'PcbPointMils', height_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP_OVERLAY: 33>, rotation_degrees: 'float' = 0.0, stroke_width_mils: 'float' = 10.0, font_kind: 'str | PcbTextKind' = <PcbTextKind.STROKE: 'stroke'>, stroke_font_type: 'int | str' = 'default', font_name: 'str' = 'Arial', bold: 'bool' = False, italic: 'bool' = False, barcode_kind: 'int | PcbBarcodeKind' = <PcbBarcodeKind.CODE_39: 0>, barcode_render_mode: 'int | PcbBarcodeRenderMode' = <PcbBarcodeRenderMode.BY_FULL_WIDTH: 1>, barcode_full_size_mils: 'tuple[float, float] | None' = None, barcode_margin_mils: 'tuple[float, float]' = (20.0, 20.0), barcode_min_width_mils: 'float' = 0.0, barcode_show_text: 'bool' = True, barcode_inverted: 'bool' = True, is_comment: 'bool' = False, is_designator: 'bool' = False, is_mirrored: 'bool' = False, is_inverted: 'bool' = False, inverted_margin_mils: 'float' = 0.0, use_inverted_rectangle: 'bool' = False, inverted_rectangle_size_mils: 'tuple[float, float] | None' = None, is_frame: 'bool' = False, frame_size_mils: 'tuple[float, float] | None' = None, text_justification: 'int | PcbTextJustification | None' = None) -> 'AltiumPcbText'Add text to this footprint using mil units.
methodadd_track(self, start_mils: 'PcbPointMils', end_mils: 'PcbPointMils', *, width_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP_OVERLAY: 33>, v7_layer_id: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None) -> 'AltiumPcbTrack'Add a straight track segment to this footprint using mil units.
methodadd_via(self, *, position_mils: 'PcbPointMils', diameter_mils: 'float', hole_size_mils: 'float', layer_start: 'PcbLayerLike' = <PcbLayer.TOP: 1>, layer_end: 'PcbLayerLike' = <PcbLayer.BOTTOM: 32>, ipc4761_via_type: 'int | PcbIpc4761ViaType' = <PcbIpc4761ViaType.NONE: 0>, ipc4761_features: 'Sequence[AltiumPcbViaStructureFeature] | None' = None, propagation_delay_ps: 'float | None' = None, hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, is_tent_top: 'bool | None' = None, is_tent_bottom: 'bool | None' = None, solder_mask_expansion_top_mils: 'float | None' = None, solder_mask_expansion_bottom_mils: 'float | None' = None, solder_mask_expansion: 'PcbMaskExpansionInput' = None, is_test_fab_top: 'bool' = False, is_test_fab_bottom: 'bool' = False, is_assy_testpoint_top: 'bool' = False, is_assy_testpoint_bottom: 'bool' = False) -> 'AltiumPcbVia'Add a via primitive to this footprint using mil units.
propertycomponent_kind -> 'ComponentKind | int'Footprint type from the `Parameters` stream; Standard when unset.
propertycomponent_kind_raw -> 'str | None'Stored `COMPONENTKIND` text, or None when the footprint has none.
classmethodfrom_data_stream(cls, name: 'str', data: 'bytes', debug: 'bool' = False) -> 'AltiumPcbFootprint'Parse footprint from binary Data stream.
methodget_summary(self) -> 'str'Return a human-readable footprint primitive count summary.
methodlayers(self) -> 'PcbLayerContext'Return the layer context this footprint is read in.
methodparse_binary_data(self, data: 'bytes', debug: 'bool' = False) -> 'None'Parse footprint from binary Data stream.
methodprimitive_guid(self, record_index: 'int') -> 'tuple[int, uuid.UUID] | None'Return the `PrimitiveGuids/Data` row of the primitive at a Data index.
propertyprimitives -> 'tuple[object, ...]'Return footprint primitives in native PcbLib `Data` stream order.
methodserialize_data_stream(self) -> 'bytes'Assemble the footprint Data stream from OOP primitives.
methodset_component_kind(self, kind: 'ComponentKind | int') -> 'None'Set the footprint type in `Parameters`, in the forms Altium saves.
methodset_footprint_primitive_parameter(self, name: 'str', value: 'str') -> 'None'Set one footprint-level user parameter in the `PrimitiveParameters` stream.
methodset_parameter(self, name: 'str', value: 'str') -> 'None'Set one footprint `Parameters` stream key.
methodto_layer_svgs(self, **options: 'Unpack[FootprintSvgOptions]') -> 'FabOutput'This footprint as one SVG image per layer key of its Fab view, in
methodto_svg(self, **options: 'Unpack[FootprintSvgOptions]') -> 'FabOutput'This footprint as one SVG image, in memory.
class

AltiumPcbLib

from altium_monkey import AltiumPcbLib
class AltiumPcbLib(filepath: 'Path | str | None' = None, *, debug: 'bool' = False) -> 'None'

Complete PcbLib file containing multiple footprints.

Author new footprint libraries with `add_footprint(...)`, attach parsed or synthesized footprints with `add_existing_footprint(...)`, and write with `save(...)`. Public PCB geometry arguments use mils by default.

Attributes: filepath: Path to PcbLib file. footprints: List of `AltiumPcbFootprint` instances in the library. models_3d: Dict of embedded STEP model payloads found during parsing.

Members (36)
KindSignatureSummary
methodadd_embedded_font(self, *, name: 'str', font_data: 'bytes', style: 'str' = '', data_is_compressed: 'bool' = False, face_name: 'str | None' = None, bold: 'bool | None' = None, italic: 'bool | None' = None) -> 'None'Append one embedded TrueType font to `raw_embedded_fonts`.
methodadd_embedded_model(self, *, name: 'str', model_data: 'bytes', model_id: 'uuid.UUID | str | None' = None, rotation_x_degrees: 'float' = 0.0, rotation_y_degrees: 'float' = 0.0, rotation_z_degrees: 'float' = 0.0, z_offset_mils: 'float' = 0.0, checksum: 'int | None' = None, model_source: 'str' = 'Undefined', data_is_compressed: 'bool' = False) -> 'AltiumPcbModel'Add an embedded 3D model payload to this PcbLib.
methodadd_existing_footprint(self, footprint: 'AltiumPcbFootprint', *, height: 'str | None' = None, description: 'str | None' = None, item_guid: 'str | None' = None, revision_guid: 'str | None' = None, copy_footprint: 'bool' = True) -> 'AltiumPcbFootprint'Attach an existing footprint to this PcbLib and return the owned instance.
methodadd_footprint(self, name: 'str', *, height: 'str' = '0mil', description: 'str' = '', item_guid: 'str' = '', revision_guid: 'str' = '') -> 'AltiumPcbFootprint'Create a footprint owned by this PcbLib.
methodasset_inventory(self, *, include_hashes: 'bool' = False) -> 'AltiumAssetInventory'Return extractable asset inventory for this PcbLib.
classmethodcombine(cls, inputs: 'Path | str | Iterable[Path | str]', *, verbose: 'bool' = False) -> 'AltiumPcbLib'Combine one or more PcbLib files into a single builder-authored library.
staticmethodcombine_provenance_path(filepath: 'Path') -> 'Path'Default JSON sidecar path for a joined/combine provenance manifest.
methodembedded_asset_inventory(self, *, include_hashes: 'bool' = False) -> 'EmbeddedAssetInventory'Return an aggregate read-only inventory for embedded PCB assets.
methodembedded_font_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbFontSummary, ...]'Return typed summaries of `embedded_fonts`.
propertyembedded_fonts -> 'list[EmbeddedFont]'The embedded TrueType fonts of `raw_embedded_fonts`.
methodembedded_model_payloads(self) -> 'tuple[bytes, ...]'Return decompressed embedded model payloads in summary order.
methodembedded_model_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbModelSummary, ...]'Return read-only embedded 3D model inventory summaries.
methodextract_asset(self, ref: 'AltiumAssetRef') -> 'AltiumExtractedAsset'Extract one asset selected from `asset_inventory()`.
methodextract_embedded_models(self, output_dir: 'Path | str', verbose: 'bool' = False) -> 'list[Path]'Extract embedded 3D model payloads to `output_dir`.
methodextract_footprint(self, ref_or_name_or_index: 'object') -> 'AltiumPcbLib'Extract one PcbLib footprint as a single-footprint PcbLib.
propertyfile_version_info -> 'FileVersionInfo'The `FileVersionInfo/Data` stream: the format changes the Altium that
methodfilename(self) -> 'str'Return the source filename portion for this library.
methodfind_footprint(self, name: 'str') -> 'AltiumPcbFootprint | None'Return the first footprint with `name`, or `None` if absent.
methodfootprint_count(self) -> 'int'Return the number of parsed or authored footprints in this library.
methodfootprint_names(self) -> 'list[str]'Return parsed or authored footprint names in library order.
classmethodfrom_bytes(cls, data: 'bytes', filename: 'Path | str' = 'embedded.PcbLib', debug: 'bool' = False) -> 'AltiumPcbLib'Parse a complete PcbLib from OLE bytes.
classmethodfrom_file(cls, filepath: 'Path', debug: 'bool' = False) -> 'AltiumPcbLib'Parse a complete PcbLib file.
methodget_embedded_model_entries(self) -> 'list[tuple[AltiumPcbModel, bytes]]'Return embedded model metadata plus compressed payload bytes.
methodget_embedded_model_payload(self, index: 'int') -> 'bytes'Return one decompressed embedded model payload by inventory index.
staticmethodget_footprint_names(filepath: 'Path') -> 'list[str]'Get footprint names without full parse (fast storage scan).
methodget_mechanical_layer_kind(self, layer: 'int | str | PcbLayer') -> 'MechanicalLayerKind | None'Return the semantic kind assigned to a mechanical layer, if present.
methodlayers(self) -> 'PcbLayerContext'Return this library's one layer context.
methodremove_mechanical_layer_pairs_for(self, layers: 'Collection[int | str | PcbLayer]') -> 'None'Remove all ``MECHPAIR*`` records referencing any layer in ``layers`` and compact indices.
methodrename_footprint(self, footprint_or_name: 'AltiumPcbFootprint | str', name: 'str') -> 'AltiumPcbFootprint'Rename one footprint owned by this library.
methodsave(self, filepath: 'Path | str', debug: 'bool' = False) -> 'None'Save to binary PcbLib format.
methodsave_subset(self, filepath: 'Path | str', footprint_names: 'Iterable[str]', debug: 'bool' = False) -> 'None'Save a PcbLib containing only the named footprints.
methodset_mechanical_layer(self, layer: 'int | str | PcbLayer', *, name: 'str | None' = None, enabled: 'bool' = True, used_by_prims: 'bool | None' = None) -> 'None'Set a mechanical layer display name and enabled state.
methodset_mechanical_layer_kind(self, layer: 'int | str | PcbLayer', kind: 'int | str | MechanicalLayerKind') -> 'None'Set the semantic kind assigned to a mechanical layer.
methodset_mechanical_layer_pair(self, layer_1: 'int | str | PcbLayer', layer_2: 'int | str | PcbLayer', *, pair_index: 'int | None' = None) -> 'None'Define a mechanical mirror pair used by component side flipping.
methodsplit(self, output_dir: 'Path', verbose: 'bool' = False) -> 'dict[str, Path]'Split this multi-footprint PcbLib into individual files.
methodwrite_combine_provenance(self, filepath: 'Path | None' = None) -> 'Path'Write a JSON sidecar describing how this library was produced by combine().
class

AltiumPcbLibPrimitiveParameterGroup

from altium_monkey import AltiumPcbLibPrimitiveParameterGroup
class AltiumPcbLibPrimitiveParameterGroup(primitive_id: 'str', appurtenance: 'str', variant_guid: 'str', parameters: 'dict[str, str]', properties: 'dict[str, str]', raw_header_payload: 'bytes | None' = None, raw_parameter_payloads: 'tuple[bytes, ...]' = ()) -> 'None'

One group from a PcbLib footprint `PrimitiveParameters` stream.

Altium uses this side stream for footprint/appurtenance user parameters. It is intentionally separate from `AltiumPcbFootprint.parameters`, which is the standard footprint `Parameters` stream containing pattern, height, description, and similar library metadata.

Members (1)
KindSignatureSummary
methodto_payloads(self) -> 'tuple[bytes, ...]'Serialize this group to raw property payloads.
class

AltiumPcbModel

from altium_monkey import AltiumPcbModel
class AltiumPcbModel() -> 'None'

PCB 3D model record.

Represents a 3D model reference for PCB components.

Attributes: name: Model filename (e.g., "resistor.step") id: Unique model identifier is_embedded: True if model data is embedded in OLE stream rotation_x: X-axis rotation (degrees) rotation_y: Y-axis rotation (degrees) rotation_z: Z-axis rotation (degrees) z_offset: Z-offset from board surface checksum: Altium native model checksum. Stored signed in `Models/Data` when the high bit is set. embedded_data: Raw embedded STEP file data (if embedded)

Note: MODEL records use property-based format, not fixed binary structure. For round-trip, we store raw binary.

Members (4)
KindSignatureSummary
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse MODEL record from binary data.
propertyrecord_type -> 'PcbRecordType'Return the PCB model record discriminator.
methodserialize_to_binary(self) -> 'bytes'Serialize MODEL record to binary format.
methodserialize_to_record(self) -> 'dict[str, Any]'MODEL primitives are stored in binary/property stream form.
class

AltiumPcbNet

from altium_monkey import AltiumPcbNet
class AltiumPcbNet(name: 'str' = '', unique_id: 'str' = '', color: 'int' = 65535, visible: 'bool' = True, override_color: 'bool' = False, keepout: 'bool' = False, locked: 'bool' = False, user_routed: 'bool' = True, loop_removal: 'bool' = True, jumpers_visible: 'bool' = True, polygon_outline: 'bool' = False, layer: 'str' = '', union_index: 'int' = 0, _raw_record: 'dict[str, Any]' = <factory>, _source_payload: 'bytes | None' = None) -> 'None'

PCB net definition.

Represents a single electrical net in the PCB design.

Attributes: name: Net name (e.g., "GND", "VCC", "NetR1_1") unique_id: Unique identifier for this net color: Net color (RGB value) keepout: Is this a keepout net locked: Is net locked visible: Is net visible user_routed: Is net manually routed loop_removal: Enable loop removal jumpers_visible: Show jumpers override_color: Override color for drawing layer: Associated layer (if any) polygon_outline: Show polygon outline union_index: Union group index

_raw_record: Complete raw record dict

Members (2)
KindSignatureSummary
classmethodfrom_record(cls, record: 'dict[str, Any]', source: 'bytes | None' = None) -> 'AltiumPcbNet'Parse net from Nets6/Data text record.
methodto_record(self) -> 'dict[str, Any]'Serialize net to Nets6/Data text record format.
class

AltiumPcbNetClass

from altium_monkey import AltiumPcbNetClass
class AltiumPcbNetClass(name: 'str' = '', kind: 'PcbNetClassKind | int' = <PcbNetClassKind.NET: 0>, member_count: 'int' = 0, members: 'list[str]' = <factory>, enabled: 'bool' = True, super_class: 'bool' = False, unique_id: 'str' = '', _raw_record: 'dict[str, Any]' = <factory>, _source_payload: 'bytes | None' = None) -> 'None'

PCB object class definition from `Classes6/Data`.

PCB object classes group objects (nets, components, pads, layers, differential pairs, polygons, etc.) together for design rule application and organization.

Attributes: name: Class name (e.g., "All Nets", "Power Nets", "Signal Nets") kind: Class type (0=Net, 1=Component, 2=From-To, 3=Pad, 4=Layer, 6=Diff Pair, 7=Polygon). Other stored values (Altium also names 5 and 8 to 12) are kept as the raw integer. member_count: Number of members in this class members: List of member names/IDs enabled: Is class enabled super_class: Whether the class is one of Altium's super classes (`SUPERCLASS=TRUE`, such as All Nets), which hold every object of their kind rather than listing members unique_id: Unique identifier

_raw_record: Complete raw record dict

Members (2)
KindSignatureSummary
classmethodfrom_record(cls, record: 'dict[str, Any]', source: 'bytes | None' = None) -> 'AltiumPcbNetClass'Parse net class from Classes6/Data text record.
methodto_record(self) -> 'dict[str, Any]'Serialize net class to Classes6/Data text record format.
class

AltiumPcbPad

from altium_monkey import AltiumPcbPad
class AltiumPcbPad() -> 'None'

PCB pad primitive record.

Represents a component pad on PCB.

Attributes: designator: Pad number/name (e.g., "1", "2", "GND") x: X position (internal units, 10k/mil) y: Y position (internal units) width: Pad width on top layer (internal units) height: Pad height on top layer (internal units) hole_size: Drill hole diameter (0 for SMT) hole_positive_tolerance: Upper drill-hole tolerance in internal units, or 0x7fffffff when unset/N/A. hole_negative_tolerance: Lower drill-hole tolerance magnitude in internal units, or 0x7fffffff when unset/N/A. shape: Pad shape (1=CIRCLE, 2=RECT, 3=OCTAGONAL) rotation: Rotation angle (degrees) layer: Layer (74=MULTI_LAYER for through-hole, 1=TOP, 32=BOTTOM for SMT) component_index: Links to component (uint16, PCB_UNLINKED_INDEX when unlinked) net_index: Links to net (uint16, PCB_UNLINKED_INDEX when unlinked) is_plated: True if through-hole is plated top_width: Top layer width (internal units) top_height: Top layer height (internal units) mid_width: Mid layer width (internal units) mid_height: Mid layer height (internal units) bot_width: Bottom layer width (internal units) bot_height: Bottom layer height (internal units) top_shape: Top layer shape mid_shape: Mid layer shape bot_shape: Bottom layer shape

Members (35)
KindSignatureSummary
methodcorner_radius_mils_on_layer(self, layer: 'PcbLayer') -> 'float'Corner radius in mils on one layer for rounded-rectangle pads.
propertycorner_radius_percent_exact -> 'float | None'Exact fractional corner percent for the top layer, or None.
propertycorner_radius_percentage -> 'int'Get corner radius percentage for top layer (0 if not rounded rect).
propertyeffective_top_shape -> 'int'Get effective top layer shape, applying SubRecord 6 alt_shape overrides.
methodexact_corner_radius_percent_on_layer(self, layer: 'PcbLayer') -> 'float | None'Exact fractional corner percent for one layer, or None.
propertyhas_removed_copper_layer_map -> 'bool'Return whether the complete persisted 32-byte map is present.
methodhas_stored_copper_land_on_layer(self, layer: 'PcbLayer') -> 'bool'Return structural stored-land applicability for a copper layer.
methodhole_center_internal_units(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[int, int]'Get drilled-hole center in internal units.
methodhole_center_mils(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[float, float]'Get drilled-hole center in mils.
propertyhole_negative_tolerance -> 'int'Lower drill-hole tolerance magnitude in internal units.
propertyhole_negative_tolerance_mils -> 'float | None'Lower drill-hole tolerance magnitude in mils, or ``None`` when unset/N/A.
propertyhole_positive_tolerance -> 'int'Upper drill-hole tolerance in internal units.
propertyhole_positive_tolerance_mils -> 'float | None'Upper drill-hole tolerance in mils, or ``None`` when unset/N/A.
propertyhole_size_mils -> 'float'Get hole size in mils.
methodis_copper_land_removed(self, layer: 'PcbLayer') -> 'bool'Return the stored removed-land state for one legacy copper layer.
propertyis_smt -> 'bool'Check if this is an SMT pad.
propertyis_through_hole -> 'bool'Check if this is a through-hole pad.
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this pad.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
methodpad_center_internal_units(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[int, int]'Get copper pad center in internal units for a given layer.
methodpad_center_mils(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[float, float]'Get copper pad center in mils for a given layer.
methodpad_offset_internal_units(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[int, int]'Get pad-center offset (internal units) for a given layer.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse PAD record from binary data.
propertypaste_settings -> 'PcbPadPasteSettings | None'The paste settings of the main block's extension, read as
propertypastemask_expansion_mils -> 'float'Get pastemask expansion in mils (manual value).
propertyrecord_type -> 'PcbRecordType'Return the PCB pad record discriminator.
propertyremoved_copper_layer_map_is_canonical -> 'bool'Return whether every persisted map byte is zero or one.
propertyremoved_copper_layers -> 'tuple[bool, ...]'Return removed-land state in legacy copper-layer order.
propertysemantic_top_shape -> 'int'Return the first-class semantic top shape, including custom pads.
methodserialize_to_binary(self) -> 'bytes'Serialize PAD record to binary format.
methodset_copper_land_removed(self, layer: 'PcbLayer', removed: 'bool') -> 'None'Set one legacy copper-layer removed-land state.
methodset_hole_tolerances_mils(self, positive_mils: 'float | None', negative_mils: 'float | None') -> 'None'Set upper/lower drill-hole tolerances in mils.
propertysoldermask_expansion_bottom -> 'int'The bottom side's solder mask expansion, internal units: the
propertysoldermask_expansion_mils -> 'float'Get soldermask expansion in mils (manual value).
propertythermal_profiles -> 'list[PcbPadThermalProfile] | None'The pad's per-layer thermal relief profiles, in saved order.
class

AltiumPcbPolygon

from altium_monkey import AltiumPcbPolygon
class AltiumPcbPolygon(outline: 'list[PcbPolygonVertex]' = <factory>, cutouts: 'list[list[PcbPolygonVertex]]' = <factory>, net: 'int | None' = None, layer: 'str' = 'TOP', polygon_type: 'str' = 'Polygon', name: 'str' = '', track_width_mils: 'float' = 10.0, hatch_style: 'str' = 'Solid', arc_resolution_mils: 'float' = 0.5, grid_size_mils: 'float' = 20.0, min_prim_length_mils: 'float' = 3.0, neck_width_threshold_mils: 'float' = 5.0, remove_dead: 'bool' = True, remove_necks: 'bool' = True, remove_islands_by_area: 'bool' = True, area_threshold: 'float' = 250000000000.0, pour_index: 'int' = 0, union_index: 'int' = 0, keepout: 'bool' = False, locked: 'bool' = False, shelved: 'bool' = False, polygon_outline: 'bool' = False, primitive_lock: 'bool' = True, obey_polygon_cutout: 'bool' = True, user_routed: 'bool' = True, pour_over: 'bool' = False, pour_over_style: 'int' = 2, use_octagons: 'bool' = False, ignore_violations: 'bool' = False, selection: 'bool' = False, restore_layer: 'str' = 'UNKNOWN', restore_net: 'str' = '', _raw_record: 'dict[str, Any]' = <factory>, _source_payload: 'bytes | None' = None) -> 'None'

PCB polygon pour definition.

Represents a copper pour region with outline, cutouts, and pour settings. The polygon is NOT rendered - just the definition. Actual copper fill is computed by Altium based on these settings and stored in ShapeBasedRegions6.

Attributes: # Geometry outline: List of vertices defining polygon outline cutouts: List of vertex lists defining cutout regions

# Properties net: Zero-based net index, or None for a pour with no net (no NET key) layer: Layer name ("TOP", "BOTTOM", "MID1", etc.) polygon_type: "Polygon" or "Cutout" name: Polygon name

Members (3)
KindSignatureSummary
classmethodfrom_record(cls, record: 'dict[str, Any]', source: 'bytes | None' = None) -> 'AltiumPcbPolygon'Parse polygon from Polygons6/Data text record.
propertylayer_ref -> 'PcbLayerRef | None'The polygon's layer: `LAYER_V7` when saved, otherwise `LAYER`.
methodto_record(self) -> 'dict[str, Any]'Serialize polygon to Polygons6/Data text record format.
class

AltiumPcbRegion

from altium_monkey import AltiumPcbRegion
class AltiumPcbRegion() -> 'None'

PCB region primitive record.

Represents a filled polygon region on PCB (copper pour, cutout, keepout).

Attributes: layer: Layer number (1=TOP, 32=BOTTOM, etc.) polygon_index: Links to APOLYGON6 record (uint16) component_index: Links to component (uint16, PCB_UNLINKED_INDEX when unlinked) net_index: Links to net (uint16, PCB_UNLINKED_INDEX when unlinked) hole_count: Number of holes in the polygon is_locked: Locked for editing (inverted bit logic) is_keepout: Keepout region is_polygon_outline: Part of polygon outline outline_vertex_count: Number of outline vertices outline_vertices: List of RegionVertex for outline contour hole_vertices: List of lists of RegionVertex for each hole: every hole the record saves (its HOLECOUNT). This record has no ``holes`` attribute; ``holes`` belongs to the shape-based twin, ``AltiumPcbShapeBasedRegion.holes``, which holds the same holes. properties: Dict of region properties (KIND, ISBOARDCUTOUT, etc.) kind: Region kind (0=copper, 1=cutout, 2=named, 3=board_cutout) cavity_height: Cavity definition height in internal units.

Members (9)
KindSignatureSummary
propertycavity_height_mils -> 'float'Cavity definition height in mils.
propertyexact_outline -> "list['PcbRegionOutlineVertex']"The Region outline with its true arcs, in mils.
propertyhas_exact_arcs -> 'bool'True when the Region stores an exact outline with at least one arc.
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this region.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse REGION record from binary data.
propertyrecord_type -> 'PcbRecordType'Return the PCB region record discriminator.
propertyregion_kind -> 'PcbRegionKind'Return the semantic public region kind for the native record fields.
methodserialize_to_binary(self) -> 'bytes'Serialize REGION record to binary format.
class

AltiumPcbRule

from altium_monkey.altium_pcb_rule import AltiumPcbRule
class AltiumPcbRule(index: 'int' = 0, selection: 'bool | None' = None, layer: 'str' = '', locked: 'bool | None' = None, polygon_outline: 'bool | None' = None, user_routed: 'bool | None' = None, keepout: 'bool | None' = None, union_index: 'int | None' = None, rule_kind: 'str' = '', net_scope: 'str' = '', layer_kind: 'str' = '', scope1_expression: 'str' = '', scope2_expression: 'str' = '', scope1: 'AltiumRuleScopeExpression' = <factory>, scope2: 'AltiumRuleScopeExpression' = <factory>, name: 'str' = '', enabled: 'bool | None' = None, priority: 'int | None' = None, comment: 'str' = '', unique_id: 'str' = '', defined_by_logical_document: 'bool | None' = None, semantic_values: 'dict[str, object]' = <factory>, extra_fields: 'dict[str, str]' = <factory>, raw_record: 'dict[str, object]' = <factory>, raw_record_payload: 'bytes' = b'', record_leader: 'bytes' = b'', _raw_record_signature: 'tuple[tuple[str, str], ...]' = <factory>, _record_order: 'tuple[str, ...]' = <factory>) -> 'None'

Typed PCB rule parsed from an Altium Rules6/Data rule record.

Members (4)
KindSignatureSummary
methodcan_passthrough_raw_payload(self) -> 'bool'
classmethodfrom_record(cls, record: 'Mapping[str, object]', *, index: 'int' = 0, record_leader: 'bytes | None' = None, record_payload: 'bytes | None' = None) -> "'AltiumPcbRule'"
methodsource_record(self) -> 'dict[str, str]'Return a serialized record view for downstream passthrough consumers.
methodto_record(self) -> 'dict[str, str]'
class

AltiumPcbShapeBasedRegion

from altium_monkey import AltiumPcbShapeBasedRegion
class AltiumPcbShapeBasedRegion() -> 'None'

Shape-based PCB region primitive record.

Represents RENDERED polygon geometry (filled copper). This is the actual copper after Altium computes thermal reliefs, clearances, etc.

Different from Polygons6 which contains polygon DEFINITIONS.

Based on record format's AREGION6 parser: Attributes: layer: PCB layer (1=TOP, 32=BOTTOM, etc.) is_locked: Is region locked is_keepout: Is keepout region net_index: Net index (uint16) polygon_index: Polygon index (uint16) component_index: Component index (uint16; None when free, 0xFFFF saved) hole_count: Number of holes/cutouts

Members (9)
KindSignatureSummary
propertycavity_height_mils -> 'float'Cavity definition height in mils.
propertyhole_vertices -> 'list[list[PcbSimpleVertex]]'
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this shape-based region.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
propertyoutline_vertices -> 'list[PcbExtendedVertex]'
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse ShapeBasedRegion record from binary data.
propertyrecord_type -> 'PcbRecordType'Return the PCB region record discriminator.
propertyregion_kind -> 'PcbRegionKind'Return the semantic public region kind for this shape-based record.
methodserialize_to_binary(self) -> 'bytes'Serialize ShapeBasedRegion record to binary format.
class

AltiumPcbText

from altium_monkey import AltiumPcbText
class AltiumPcbText() -> 'None'

PCB text primitive record.

Represents a text label on PCB.

Attributes: x: X position (internal units, 10k/mil) y: Y position (internal units) height: Text height (internal units) rotation: Rotation angle (degrees, 0 deg = horizontal) stroke_width: Line width for stroke fonts (internal units) layer: Layer number (1=TOP, 32=BOTTOM, etc.) component_index: Links to component (uint16, PCB_UNLINKED_INDEX when unlinked) is_mirrored: True if text is mirrored is_comment: True if this is a component comment/value is_designator: True if this is a component designator text_content: Actual text string (resolved from WideStrings6/Data) widestring_index: Index into WideStrings6 table (uint32) stroke_font_type: Font type for stroke fonts (uint16, 1=Default, 2=Sans Serif, 3=Serif; 0 accepted only as compatibility fallback)

Members (14)
KindSignatureSummary
propertybarcode_full_height_mils -> 'float'Get barcode full height in mils.
propertybarcode_full_width_mils -> 'float'Get barcode full width in mils.
propertybarcode_min_width_mils -> 'float'Get barcode minimum bar width in mils.
propertyeffective_justification -> 'int'Get effective justification for rendering.
propertyheight_mils -> 'float'Get text height in mils.
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this text primitive.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse TEXT record from binary data.
propertyrecord_type -> 'PcbRecordType'Return the PCB text record discriminator.
methodresolve_text_content(self, widestrings_table: 'dict[int, str]') -> 'None'Resolve text content from WideStrings6 table.
methodserialize_to_binary(self) -> 'bytes'Serialize TEXT record to binary format.
propertystroke_width_mils -> 'float'Get stroke width in mils.
propertytextbox_rect_height_mils -> 'float'Get textbox rect height in mils.
propertytextbox_rect_width_mils -> 'float'Get textbox rect width in mils.
class

AltiumPcbTrack

from altium_monkey import AltiumPcbTrack
class AltiumPcbTrack() -> 'None'

PCB track primitive record.

Represents a straight line segment on PCB (copper trace or silkscreen line).

Attributes: start_x: Start X position (internal units, 10k/mil) start_y: Start Y position (internal units) end_x: End X position (internal units) end_y: End Y position (internal units) width: Line width (internal units) layer: Layer number (1=TOP, 32=BOTTOM, etc.) component_index: Links to component (uint16, PCB_UNLINKED_INDEX when unlinked) net_index: Links to net (uint16, PCB_UNLINKED_INDEX when unlinked) polygon_index: Polygon index (uint16) subpoly_index: Sub-polygon index (uint16) union_index: Header union field (uint32, 0xFFFFFFFF=none). For AD25/AD26 user unions, Altium keeps this field at the sentinel and encodes the visible union id in `solder_mask_expansion`. is_locked: Locked for editing is_keepout: Keepout track is_polygon_outline: Part of polygon outline user_routed: True if manually routed (flags1 bit 3) solder_mask_expansion: Solder mask expansion value (int32, internal units) paste_mask_expansion: Paste mask expansion value (int16, always 0 in practice) v7_layer_id: V7 layer identifier field (uint32) keepout_restrictions: Keepout bitmask. Use `altium_pcb_keepout` helpers for the SDK-confirmed bit names.

Members (10)
KindSignatureSummary
propertyend_x_mils -> 'float'Get end X in mils.
propertyend_y_mils -> 'float'Get end Y in mils.
methodlayer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this track.
methodlayer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse TRACK record from binary data.
propertyrecord_type -> 'PcbRecordType'Return the PCB track record discriminator.
methodserialize_to_binary(self) -> 'bytes'Serialize TRACK record to binary format.
propertystart_x_mils -> 'float'Get start X in mils.
propertystart_y_mils -> 'float'Get start Y in mils.
propertywidth_mils -> 'float'Get width in mils.
class

AltiumPcbVia

from altium_monkey import AltiumPcbVia
class AltiumPcbVia() -> 'None'

PCB via primitive record.

Represents a via (through-hole or blind/buried) on PCB.

Attributes: x: X position (internal units, 10k/mil) y: Y position (internal units) diameter: Via pad diameter (internal units) hole_size: Drill hole diameter (internal units) layer_start: Start layer (1=TOP, 32=BOTTOM) layer_end: End layer net_index: Links to net (uint16, PCB_UNLINKED_INDEX when unlinked)

# Linkage polygon_index: Polygon pour linkage (uint16, PCB_UNLINKED_INDEX when unlinked) component_index: Component linkage (uint16, None=free primitive) [from PcbPrimitive]

Members (32)
KindSignatureSummary
propertydiameter_mils -> 'float'Via diameter in mils.
methodend_layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware signal-layer ref for the via span end.
methodget_ipc4761_feature(self, feature_type: 'PcbViaStructureFeatureType | int') -> 'AltiumPcbViaStructureFeature | None'Return one IPC-4761 feature-table row attached to this via.
propertyhole_negative_tolerance -> 'int'Lower drill-hole tolerance magnitude in internal units.
propertyhole_negative_tolerance_mils -> 'float | None'Lower drill-hole tolerance magnitude in mils, or ``None`` when unset/N/A.
propertyhole_positive_tolerance -> 'int'Upper drill-hole tolerance in internal units.
propertyhole_positive_tolerance_mils -> 'float | None'Upper drill-hole tolerance in mils, or ``None`` when unset/N/A.
propertyhole_size_mils -> 'float'Hole size in mils.
methodlayer_span_refs(self, registry: 'PcbLayerRegistry | None' = None) -> 'tuple[PcbLayerRef, PcbLayerRef]'Return `(start_ref, end_ref)` for the via signal-layer span.
propertynative_union_index -> 'int'The complete native `UnionIndex` dword at payload +70..+73.
propertyneg_tolerance -> 'int'Alias for `hole_negative_tolerance`.
methodparse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse VIA record from binary data.
propertypos_tolerance -> 'int'Alias for `hole_positive_tolerance`.
propertypropagation_delay -> 'float'Alias for `propagation_delay_ps`.
propertypropagation_delay_ps -> 'float'Via propagation delay in picoseconds.
propertyrecord_type -> 'PcbRecordType'Return the PCB via record discriminator.
methodremove_copper_lands(self, layers: 'Sequence[PcbLayerLike]') -> 'None'Remove the via's land on each copper layer, as Altium saves such a via:
methodserialize_to_binary(self) -> 'bytes'Serialize VIA record to binary format.
methodset_hole_tolerances_mils(self, positive_mils: 'float | None', negative_mils: 'float | None') -> 'None'Set upper/lower drill-hole tolerances in mils.
methodset_ipc4761_feature(self, feature_type: 'PcbViaStructureFeatureType | int', *, side: 'PcbViaStructureFeatureSide | int | None' = None, material: 'str | None' = None) -> 'AltiumPcbViaStructureFeature'Update one IPC-4761 feature-table row for this via.
methodset_ipc4761_feature_material(self, feature_type: 'PcbViaStructureFeatureType | int', material: 'str') -> 'AltiumPcbViaStructureFeature'Update the material column for one IPC-4761 feature-table row.
methodset_ipc4761_feature_side(self, feature_type: 'PcbViaStructureFeatureType | int', side: 'PcbViaStructureFeatureSide | int') -> 'AltiumPcbViaStructureFeature'Update the side column for one IPC-4761 feature-table row.
methodset_uniform_diameter_mils(self, diameter_mils: 'float') -> 'None'Set SIMPLE Via core and inline diameters together, in mils.
propertysoldermask_expansion_linked -> 'bool'Deprecated inverse of ``uses_separate_mask_expansions``.
propertysoldermask_expansion_manual -> 'bool'Derived: True when solder_mask_expansion_mode == 2 (Manual).
propertystackcr_use_percent_flags -> 'tuple[bool, ...]'Return StackCR use-percent lane booleans derived from raw lane tokens.
methodstart_layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware signal-layer ref for the via span start.
propertytents_by_rule -> 'bool'Whether the via's tenting follows the mask rule rather than its
propertythermal_profiles -> 'list[PcbPadThermalProfile] | None'The via's saved thermal relief profiles, in the pad entry form
propertyuses_separate_mask_expansions -> 'bool'Whether the bottom solder-mask expansion is stored apart from the top.
propertyx_mils -> 'float'X position in mils.
propertyy_mils -> 'float'Y position in mils.
class

AltiumPcbViaStructure

from altium_monkey import AltiumPcbViaStructure
class AltiumPcbViaStructure(structure_type: 'PcbIpc4761ViaTypeValue', features: 'tuple[AltiumPcbViaStructureFeature, ...]', properties: 'dict[str, str]', raw_payload: 'bytes') -> 'None'

One IPC-4761 via-structure record from `ViaStructureManager/Data`.

Members (5)
KindSignatureSummary
methodget_feature(self, feature_type: 'PcbViaStructureFeatureTypeValue') -> 'AltiumPcbViaStructureFeature | None'Return the row for an IPC-4761 feature type, if present.
propertyipc4761_via_type -> 'PcbIpc4761ViaTypeValue'
propertymetadata -> 'str'
methodto_payload(self) -> 'bytes'
methodwith_feature(self, feature_type: 'PcbViaStructureFeatureTypeValue', *, side: 'PcbViaStructureFeatureSideValue | None' = None, material: 'str | None' = None) -> "'AltiumPcbViaStructure'"Return a copy with one feature-table row updated.
class

AltiumPcbViaStructureFeature

from altium_monkey import AltiumPcbViaStructureFeature
class AltiumPcbViaStructureFeature(feature_type: 'PcbViaStructureFeatureTypeValue', side: 'PcbViaStructureFeatureSideValue', material: 'str' = '') -> 'None'

One IPC-4761 feature row from a via-structure record.

class

AltiumPhysicalStack

from altium_monkey.altium_layer_stack_document import AltiumPhysicalStack
class AltiumPhysicalStack(stack_ref: 'str', display_name: 'str', source_family: 'str', is_flex: 'bool | None' = None, service_stackup: 'bool | None' = None, used_by_primitives: 'bool | None' = None, stackupx_is_flex: 'bool | None' = None, stackupx_stack_type: 'str | None' = None, layers: 'tuple[AltiumStackLayer, ...]' = ()) -> 'None'

Ordered physical stack with native source family metadata.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumRigidCopperLayerSpec

from altium_monkey import AltiumRigidCopperLayerSpec
class AltiumRigidCopperLayerSpec(name: 'str', copper_thickness_mils: 'float' = 1.4, component_placement: 'int | None' = None, copper_orientation: 'int | None' = None) -> 'None'

Authored rigid-board copper layer input for new PcbDoc stack synthesis.

class

AltiumRigidDielectricLayerSpec

from altium_monkey import AltiumRigidDielectricLayerSpec
class AltiumRigidDielectricLayerSpec(name: 'str', thickness_mils: 'float', dielectric_constant: 'float', material: 'str', dielectric_type: 'int' = 0, loss_tangent: 'float | None' = None) -> 'None'

Authored rigid-board dielectric layer input for new PcbDoc stack synthesis.

class

AltiumRigidStackRowSpec

from altium_monkey import AltiumRigidStackRowSpec
class AltiumRigidStackRowSpec(name: 'str', family: 'str', layer_id: 'int | None' = None, legacy_layer_id: 'int | None' = None, stackupx_type_id: 'str' = '', copper_thickness_mils: 'float | None' = None, dielectric_constant: 'float | None' = None, dielectric_loss_tangent: 'float | None' = None, dielectric_height_mils: 'float | None' = None, dielectric_material: 'str' = '', dielectric_type: 'int | None' = None, component_placement: 'int | None' = None, used_by_primitives: 'bool | None' = None, coverlay_expansion: 'str' = '', is_stiffener: 'bool | None' = None, is_adhesive: 'bool | None' = None, source_record_id: 'str' = '', registry_ref: 'str' = '', stackupx_properties: 'tuple[tuple[str, str, str], ...]' = (), stackupx_is_shared: 'bool | None' = None, dielectric_type_raw: 'int | None' = None) -> 'None'

Authored rigid-board physical row input for new PcbDoc stack synthesis.

This lower-level constructor input preserves the ordered row model used by `.stackup` and `.stackupx` files, including adjacent dielectric rows, solder-mask/overlay rows, StackupX properties, and explicit native layer metadata. Use `from_rigid_stack(...)` for the simpler copper plus one-dielectric-per-span case.

``dielectric_type`` uses authored ``AltiumDielectricLayerKind`` values. ``dielectric_type_raw`` preserves native DIELTYPE values when copying rows; the authored field takes precedence when both are supplied.

Members (7)
KindSignatureSummary
classmethodcopper(cls, name: 'str', *, thickness_mils: 'float | None' = None, thickness_mm: 'float | None' = None, component_placement: 'AltiumComponentPlacement | int | None' = None, material: 'AltiumCopperMaterialSpec | None' = None, copper_orientation: 'int | None' = None, stackupx_properties: 'Sequence[tuple[str, str, str]]' = ()) -> "'AltiumRigidStackRowSpec'"Build a copper row from semantic thickness and placement fields.
classmethodcore(cls, name: 'str', *, thickness_mils: 'float | None' = None, thickness_mm: 'float | None' = None, dielectric_constant: 'float | None' = None, loss_tangent: 'float | None' = None, material: 'str | AltiumDielectricMaterialSpec', stackupx_properties: 'Sequence[tuple[str, str, str]]' = ()) -> "'AltiumRigidStackRowSpec'"Build a core row.
classmethoddielectric(cls, name: 'str', *, kind: 'AltiumDielectricLayerKind | int', thickness_mils: 'float | None' = None, thickness_mm: 'float | None' = None, dielectric_constant: 'float | None' = None, loss_tangent: 'float | None' = None, material: 'str | AltiumDielectricMaterialSpec', stackupx_properties: 'Sequence[tuple[str, str, str]]' = ()) -> "'AltiumRigidStackRowSpec'"Build a dielectric row such as a core, prepreg, or coverlay row.
classmethodfrom_stack_layer(cls, layer: 'object') -> "'AltiumRigidStackRowSpec'"Copy an existing source-aware stack row into authored-row input.
classmethodoverlay(cls, name: 'str') -> "'AltiumRigidStackRowSpec'"Build an overlay/legend row.
classmethodprepreg(cls, name: 'str', *, thickness_mils: 'float | None' = None, thickness_mm: 'float | None' = None, dielectric_constant: 'float | None' = None, loss_tangent: 'float | None' = None, material: 'str | AltiumDielectricMaterialSpec', stackupx_properties: 'Sequence[tuple[str, str, str]]' = ()) -> "'AltiumRigidStackRowSpec'"Build a prepreg row.
classmethodsolder_mask(cls, name: 'str', *, thickness_mils: 'float | None' = None, thickness_mm: 'float | None' = None, dielectric_constant: 'float | None' = None, material: 'str | AltiumDielectricMaterialSpec' = 'Solder Resist', coverlay_expansion: 'str' = '0mm', stackupx_properties: 'Sequence[tuple[str, str, str]]' = ()) -> "'AltiumRigidStackRowSpec'"Build a solder-mask row from semantic thickness/material fields.
class

AltiumStackBendLine

from altium_monkey.altium_layer_stack_document import AltiumStackBendLine
class AltiumStackBendLine(angle_deg: 'float | None' = None, radius_raw: 'int | None' = None, fold_index: 'int | None' = None, x1: 'int | None' = None, y1: 'int | None' = None, x2: 'int | None' = None, y2: 'int | None' = None, raw_value: 'str' = '') -> 'None'

Typed bend-line metadata from BoardRegions/Data.

Members (2)
KindSignatureSummary
propertyradius_mils -> 'float | None'Bend radius in mils, derived from the native raw coordinate value.
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumStackBranch

from altium_monkey.altium_layer_stack_document import AltiumStackBranch
class AltiumStackBranch(source_branch_id: 'str', name: 'str', description: 'str' = '', parent_branch_id: 'str' = '', sections: 'tuple[AltiumStackBranchSection, ...]' = ()) -> 'None'

Layer Stack Manager branch topology.

Members (2)
KindSignatureSummary
propertyroot_stack_ref -> 'str'
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumStackBranchSection

from altium_monkey.altium_layer_stack_document import AltiumStackBranchSection
class AltiumStackBranchSection(source_section_id: 'str', name: 'str', parent_section_id: 'str' = '', stacks: 'tuple[AltiumStackBranchStack, ...]' = ()) -> 'None'

One topology node inside an LSM rigid-flex branch.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumStackBranchStack

from altium_monkey.altium_layer_stack_document import AltiumStackBranchStack
class AltiumStackBranchStack(source_stack_ref: 'str', description: 'str' = '', source_record_id: 'str' = '', material_usage: 'str' = '', source: 'str' = '', parent_layer_id: 'str' = '', parent_layer_stack_id: 'str' = '', source_layer_id: 'str' = '', source_layer_stack_id: 'str' = '', is_left_intrusions_linked: 'bool | None' = None, intrusion_left_bottom: 'str' = '', intrusion_left_top: 'str' = '', is_right_intrusions_linked: 'bool | None' = None, intrusion_right_bottom: 'str' = '', intrusion_right_top: 'str' = '') -> 'None'

One stack reference inside a Layer Stack Manager branch section.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumStackLayer

from altium_monkey.altium_layer_stack_document import AltiumStackLayer
class AltiumStackLayer(stack_index: 'int', registry_ref: 'str', display_name: 'str', family: 'str', source_family: 'str', source_record_id: 'str' = '', layer_id: 'int | None' = None, legacy_layer_id: 'int | None' = None, stackupx_type_id: 'str' = '', copper_thickness_mils: 'float | None' = None, dielectric_constant: 'float | None' = None, dielectric_loss_tangent: 'float | None' = None, dielectric_height_mils: 'float | None' = None, dielectric_material: 'str' = '', dielectric_type: 'int | None' = None, component_placement: 'int | None' = None, used_by_primitives: 'bool | None' = None, coverlay_expansion: 'str' = '', is_stiffener: 'bool | None' = None, is_adhesive: 'bool | None' = None, substack_contexts: 'tuple[tuple[str, int | None], ...]' = (), source_keys: 'tuple[str, ...]' = (), stackupx_properties: 'tuple[tuple[str, str, str], ...]' = (), stackupx_substack_properties: 'tuple[tuple[str, tuple[tuple[str, str, str], ...]], ...]' = (), stackupx_is_shared: 'bool | None' = None, stackupx_substack_is_shared: 'tuple[tuple[str, bool], ...]' = (), stackupx_substack_is_enabled: 'tuple[tuple[str, bool], ...]' = ()) -> 'None'

One ordered physical layer-stack row.

``dielectric_type`` preserves native DIELTYPE: 0 unspecified, 1 Core, 2 Prepreg, 3 SurfaceMaterial, 4 Film; unknown integers remain raw.

Members (2)
KindSignatureSummary
methodis_enabled_for_substack(self, source_stackup_ref: 'str') -> 'bool'
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumStackRegion

from altium_monkey.altium_layer_stack_document import AltiumStackRegion
class AltiumStackRegion(name: 'str', layerstack_id: 'str' = '', locked_3d: 'bool' = False, is_shapebased: 'bool' = False, cavity_height: 'str' = '', layer_token: 'str' = '', v7_layer: 'str' = '', bending_lines: 'tuple[AltiumStackBendLine, ...]' = (), outline_vertices: 'tuple[tuple[float, float], ...]' = (), hole_vertices: 'tuple[tuple[tuple[float, float], ...], ...]' = (), raw_property_keys: 'tuple[str, ...]' = (), raw_properties: 'tuple[tuple[str, str], ...]' = (), extended_outline_tail_base64: 'str' = '', preserve_raw_property_order: 'bool' = False) -> 'None'

Board-region layer-stack context and bend-line evidence.

Members (2)
KindSignatureSummary
propertybending_line_count -> 'int'
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumStackSubstack

from altium_monkey.altium_layer_stack_document import AltiumStackSubstack
class AltiumStackSubstack(index: 'int', field_family: 'str', source_stackup_ref: 'str', name: 'str', is_flex: 'bool | None' = None, show_top_dielectric: 'bool | None' = None, show_bottom_dielectric: 'bool | None' = None, service_stackup: 'bool | None' = None, used_by_primitives: 'bool | None' = None, raw_stackup_type: 'str' = '', stackupx_is_flex: 'bool | None' = None, stackupx_stack_type: 'str | None' = None, enabled_layer_refs: 'tuple[str, ...]' = ()) -> 'None'

Rigid/flex substack metadata plus enabled physical layer refs.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumStackupDocument

from altium_monkey import AltiumStackupDocument
class AltiumStackupDocument(version: 'str', document_id: 'str', revision_id: 'str', revision_date: 'str', records: 'tuple[tuple[str, str], ...]', features: 'tuple[StackupTextFeature, ...]', source_path: 'str' = '') -> 'None'

AltiumStackupDocument(version: 'str', document_id: 'str', revision_id: 'str', revision_date: 'str', records: 'tuple[tuple[str, str], ...]', features: 'tuple[StackupTextFeature, ...]', source_path: 'str' = '')

Members (9)
KindSignatureSummary
classmethodfrom_bytes(cls, data: 'bytes', *, source_path: 'str' = '') -> "'AltiumStackupDocument'"
classmethodfrom_file(cls, path: 'str | Path') -> "'AltiumStackupDocument'"
classmethodfrom_layer_stack_document(cls, document: "'AltiumLayerStackDocument'") -> "'AltiumStackupDocument'"Build a rigid `.stackup` interchange document from the common model.
classmethodfrom_text(cls, text: 'str', *, source_path: 'str' = '') -> "'AltiumStackupDocument'"
methodto_debug_json(self) -> 'dict[str, object]'
methodto_layer_stack_document(self) -> "'AltiumLayerStackDocument'"Build an `AltiumLayerStackDocument` from the exported V8 LSM records.
methodto_record_mapping(self) -> 'dict[str, str]'
methodto_text(self) -> 'str'Serialize this document as Altium's pipe-delimited `.stackup` text.
methodwrite(self, path: 'str | Path') -> 'Path'Write this document to `path` and return the resolved path object.
class

AltiumStackupSettings

from altium_monkey import AltiumStackupSettings
class AltiumStackupSettings(stackup_type: 'AltiumStackupType' = <AltiumStackupType.STANDARD: 'Standard'>, realistic_ratio: 'bool' = True, is_symmetric: 'bool | None' = None, roughness_model: 'AltiumStackupRoughnessModel' = <AltiumStackupRoughnessModel.NO_ROUGHNESS: 'NoRoughness'>, roughness_factor_model_sr: 'str' = '0um', roughness_factor_model_rf: 'str' = '1%', copper_resistance: 'str' = '17.24nohm', via_plating_thickness: 'str' = '0.6mil', ambient_temperature: 'str' = '20C', temperature_rise: 'str' = '50C') -> 'None'

Semantic Layer Stack Manager stackup-level electrical settings.

These fields map to Altium's StackupData/IStackupData model. They serialize to StackupX `<Stackup ...>` attributes and can be read from native `LAYERMASTERSTACK_V8*` fields when a PcbDoc source exposes them.

Members (3)
KindSignatureSummary
classmethoddefault(cls) -> "'AltiumStackupSettings'"Return Altium's default stackup-level electrical settings.
classmethodfrom_stackup_attributes(cls, attributes: 'Sequence[tuple[str, str]]') -> "'AltiumStackupSettings'"Build typed settings from serialized StackupX/native attribute pairs.
methodto_stackup_attributes(self) -> 'tuple[tuple[str, str], ...]'Return serialized StackupX/native attribute pairs.
class

AltiumStackupXDocument

from altium_monkey import AltiumStackupXDocument
class AltiumStackupXDocument(serializer_version: 'str', version: 'str', revision_date: 'str', features: 'tuple[StackupXFeature, ...]', stackup_attributes: 'tuple[tuple[str, str], ...]', stacks: 'tuple[StackupXStack, ...]', branches: 'tuple[StackupXBranch, ...]', impedance_profiles: 'tuple[StackupXImpedanceProfile, ...]' = (), source_path: 'str' = '', *, id: 'str' = <factory>, revision_id: 'str' = <factory>) -> 'None'

AltiumStackupXDocument(serializer_version: 'str', version: 'str', revision_date: 'str', features: 'tuple[StackupXFeature, ...]', stackup_attributes: 'tuple[tuple[str, str], ...]', stacks: 'tuple[StackupXStack, ...]', branches: 'tuple[StackupXBranch, ...]', impedance_profiles: 'tuple[StackupXImpedanceProfile, ...]' = (), source_path: 'str' = '', *, id: 'str' = <factory>, revision_id: 'str' = <factory>)

Members (12)
KindSignatureSummary
classmethodfrom_bytes(cls, data: 'bytes', *, source_path: 'str' = '') -> "'AltiumStackupXDocument'"
classmethodfrom_embedded_bytes(cls, data: 'bytes') -> "'AltiumStackupXDocument'"Parse the StackupX XML a PcbDoc embeds in Board6 `V9_STACKCUSTOMDATA`.
classmethodfrom_file(cls, path: 'str | Path') -> "'AltiumStackupXDocument'"
classmethodfrom_layer_stack_document(cls, document: "'AltiumLayerStackDocument'") -> "'AltiumStackupXDocument'"Build a rigid `.stackupx` interchange document from the common model.
classmethodfrom_text(cls, text: 'str', *, source_path: 'str' = '') -> "'AltiumStackupXDocument'"
methodstack_by_name(self, name: 'str') -> 'StackupXStack | None'
propertystack_names -> 'tuple[str, ...]'
methodto_bytes(self) -> 'bytes'Serialize this document as UTF-8 `.stackupx` XML bytes.
methodto_debug_json(self) -> 'dict[str, object]'
methodto_layer_stack_document(self) -> "'AltiumLayerStackDocument'"Build an `AltiumLayerStackDocument` view from proven StackupX fields.
methodto_text(self) -> 'str'Serialize this document as Altium `.stackupx` XML.
methodwrite(self, path: 'str | Path') -> 'Path'Write this document to `path` and return the resolved path object.
class

AltiumTransmissionLine

from altium_monkey.altium_layer_stack_document import AltiumTransmissionLine
class AltiumTransmissionLine(index: 'int', source_family: 'str', profile_id: 'str', substack_id: 'str', layer_id: 'str', layer_token: 'str', is_differential: 'bool | None' = None, top_ref_id: 'str' = '', top_ref_token: 'str' = '', bottom_ref_id: 'str' = '', bottom_ref_token: 'str' = '', width: 'str' = '', gap: 'str' = '', calc_mode: 'str' = '', calc_mode_raw: 'int | None' = None, impedance_error: 'str' = '', tl_type_name: 'str' = '', has_plating: 'bool | None' = None, use_solder_mask: 'bool | None' = None, coated_height_1: 'str' = '', coated_height_2: 'str' = '', clearance_to_plane: 'str' = '', electric_parameters: 'tuple[tuple[str, str], ...]' = ()) -> 'None'

Layer Stack Manager transmission-line row for one impedance profile/layer.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

AltiumTransmissionLineSpec

from altium_monkey import AltiumTransmissionLineSpec
class AltiumTransmissionLineSpec(layer: 'str', top_reference: 'str' = '', bottom_reference: 'str' = '', is_differential: 'bool | None' = None, width: 'str' = '', gap: 'str' = '', calc_mode: 'str' = '', calc_mode_raw: 'int | None' = None, impedance_error: 'str' = '', tl_type_name: 'str' = '', has_plating: 'bool | None' = None, use_solder_mask: 'bool | None' = None, coated_height_1: 'str' = '', coated_height_2: 'str' = '', clearance_to_plane: 'str' = '', electric_parameters: 'tuple[tuple[str, str], ...]' = ()) -> 'None'

Authored transmission-line input for a rigid stack impedance profile.

Layer selectors accept canonical Altium tokens such as `TOP`, `MID1`, and `BOTTOM`, or copper layer display names from the authored stack.

class

BoardOutlineVertex

from altium_monkey import BoardOutlineVertex
class BoardOutlineVertex(x_mils: 'float', y_mils: 'float', is_arc: 'bool' = False, center_x_mils: 'float' = 0.0, center_y_mils: 'float' = 0.0, radius_mils: 'float' = 0.0, start_angle_deg: 'float | None' = None, end_angle_deg: 'float | None' = None) -> 'None'

Single board-outline vertex in public PCB mil units.

The segment type is attached to the starting vertex: a plain vertex starts a line segment to the next vertex, while an arc vertex starts a circular arc segment to the next vertex using the stored center, radius, and angles.

Members (2)
KindSignatureSummary
classmethodarc(cls, x_mils: 'float', y_mils: 'float', *, center_mils: 'tuple[float, float]', radius_mils: 'float', start_angle_degrees: 'float', end_angle_degrees: 'float') -> 'BoardOutlineVertex'Create a vertex that starts a circular arc segment to the next vertex.
classmethodline(cls, x_mils: 'float', y_mils: 'float') -> 'BoardOutlineVertex'Create a vertex that starts a straight segment to the next vertex.
class

EmbeddedPcbFontSummary

from altium_monkey import EmbeddedPcbFontSummary
class EmbeddedPcbFontSummary(kind: "Literal['font']", index: 'int', source_kind: "Literal['pcbdoc', 'pcblib']", source_path: 'str | None', family_name: 'str', style: 'str', extraction_filename: 'str', compressed_size: 'int | None', decompressed_size: 'int | None', raw_size: 'int | None', payload_available: 'bool', payload_sha256: 'str | None' = None, support_status: "Literal['supported', 'opaque', 'unsupported']" = 'supported') -> 'None'

Read-only summary for an embedded PCB TrueType font payload.

class

EmbeddedPcbModelSummary

from altium_monkey import EmbeddedPcbModelSummary
class EmbeddedPcbModelSummary(kind: "Literal['model']", index: 'int', source_kind: "Literal['pcbdoc', 'pcblib']", source_path: 'str | None', name: 'str', id: 'str', extraction_filename: 'str', model_format: "Literal['step', 'parasolid_text', 'parasolid_binary', 'solidworks', 'unknown']", is_embedded: 'bool', compressed_size: 'int', decompressed_size: 'int | None', payload_available: 'bool', payload_sha256: 'str | None' = None, altium_checksum: 'int | None' = None, references: 'tuple[EmbeddedAssetReference, ...]' = ()) -> 'None'

Read-only summary for an embedded PCB 3D model payload.

class

PcbBoardStackDeclarationEvidence

from altium_monkey.altium_layer_stack_document import PcbBoardStackDeclarationEvidence
class PcbBoardStackDeclarationEvidence(family: '_BoardStackDeclarationFamily', source_key: 'str | None', state: '_BoardStackDeclarationState') -> 'None'

One original Board6 declaration, without topology or applicability claims.

class

PcbBoardStackSourceEvidence

from altium_monkey.altium_layer_stack_document import PcbBoardStackSourceEvidence
class PcbBoardStackSourceEvidence(status: "Literal['current', 'unresolved']", declarations: 'tuple[PcbBoardStackDeclarationEvidence, ...]', unresolved_reason: '_BoardStackSourceUnresolvedReason | None') -> 'None'

Original declaration observations and their current Source binding.

class

PcbBoardViaSpan

from altium_monkey.altium_pcb_layer_context import PcbBoardViaSpan
class PcbBoardViaSpan(top: 'int', bottom: 'int', drill_pair: 'int | None', provisional: 'bool') -> 'None'

A via's span on the board, its outer copper in stack order.

The A0 convention runs top to bottom.

class

PcbContextBoardRegion

from altium_monkey.altium_pcb_layer_context import PcbContextBoardRegion
class PcbContextBoardRegion(id: 'int', name: 'str', substack: 'int | None', outline_mils: 'tuple[tuple[float, float], ...]' = (), holes_mils: 'tuple[tuple[tuple[float, float], ...], ...]' = (), locked_3d: 'bool' = False, bend_lines: 'int' = 0, custom_coverlays: 'bool' = False) -> 'None'

One board region and the substack its construction follows.

class

PcbContextDrillPair

from altium_monkey.altium_pcb_layer_context import PcbContextDrillPair
class PcbContextDrillPair(low: 'int', high: 'int', inverted: 'bool', backdrill: 'bool', kind: 'PcbDrillPairKind | None', substacks: 'tuple[int, ...]', drawing_name: 'str' = '', guide_name: 'str' = '') -> 'None'

One drill layer pair, kept as Altium data.

Its endpoints are legacy (TV6) layers in Altium (the Layer Identity notes, "Canonical Layer Model"); no order is forced on them.

class

PcbContextLayer

from altium_monkey.altium_pcb_layer_context import PcbContextLayer
class PcbContextLayer(id: 'int', ref: 'PcbLayerRef', kind: 'PcbLayerKind', name: 'str', key: 'str', token: 'str', order: 'int', side: 'PcbLayerFace | None', physical: 'bool', mechanical_number: 'int | None' = None, mechanical_role: 'MechanicalLayerKind | None' = None) -> 'None'

One layer of a document's context.

class

PcbContextPhysicalRow

from altium_monkey.altium_pcb_layer_context import PcbContextPhysicalRow
class PcbContextPhysicalRow(id: 'int', name: 'str', family: 'PcbPhysicalRowFamily', layer: 'int | None', thickness_nm: 'int | None', material: 'str | None', material_color: 'str | None', dielectric_type: 'PcbDielectricType | None', dielectric_constant: 'float | None', loss_tangent: 'float | None', component_placement: 'AltiumComponentPlacement | None', coverlay_expansion_nm: 'int | None', substacks: 'tuple[int, ...]') -> 'None'

One physical row of the board's stack.

A value is None when the source saves none. Lengths are integer nm (`internal_units_to_nm`); planar context geometry stays in mils.

class

PcbContextSubstack

from altium_monkey.altium_pcb_layer_context import PcbContextSubstack
class PcbContextSubstack(id: 'int', name: 'str', source_ref: 'str', kind: 'PcbSubstackKind', is_service: 'bool', layers: 'tuple[int, ...]') -> 'None'

One substack, its layers ordered top to bottom.

class

PcbCustomPadLayerShapeSpec

from altium_monkey import PcbCustomPadLayerShapeSpec
class PcbCustomPadLayerShapeSpec(layer: 'int | PcbLayer', outline_points_mils: 'Sequence[tuple[float, float] | PcbRegionOutlineVertex]', hole_points_mils: 'Sequence[Sequence[tuple[float, float]]]' = (), outline_points_are_local: 'bool' = True, outline_vertices: 'Sequence[PcbExtendedVertex] | None' = None, guid: 'uuid.UUID | None' = None) -> 'None'

Additional layer-specific PcbDoc custom-pad body geometry.

class

PcbDocBuilder

from altium_monkey import PcbDocBuilder
class PcbDocBuilder(profile: 'PcbDocBuildProfile | None' = None, *, filepath: 'str | Path | None' = None) -> 'None'

Dedicated board builder.

Owns the OLE stream inventory for the default empty-board profile and reproduces it without going through `AltiumPcbDoc.save()`.

Members (75)
KindSignatureSummary
methodadd_arc(self, *, center_mils: 'tuple[float, float]', radius_mils: 'float', start_angle: 'float', end_angle: 'float', width_mils: 'float', layer: 'PcbLayerLike' = 'Top Layer', net: 'str | AltiumPcbNet | None' = None, component_index: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"
methodadd_component(self, *, designator: 'str', footprint: 'str', position_mils: 'tuple[float, float]', layer: 'str | PcbLayer | int' = 'TOP', rotation_degrees: 'float' = 0.0, source_footprint_library: 'str' = '', name_on: 'bool' = True, comment_on: 'bool' = False, name_auto_position: 'PcbTextAutoposition | None' = None, comment_auto_position: 'PcbTextAutoposition | None' = None, description: 'str' = '', parameters: 'dict[str, str] | None' = None, unique_id: 'str | None' = None, channel_offset: 'int | None' = None, source_designator: 'str | None' = None, source_unique_id: 'str' = '', source_hierarchical_path: 'str' = '', source_component_library: 'str' = '', source_component_library_identifier_kind: 'PcbLibIdentifierKind | None' = None, source_component_library_identifier: 'str' = '', source_lib_reference: 'str' = '', footprint_description: 'str' = '', lock_strings: 'bool | None' = None, enable_pin_swapping: 'bool | None' = None, enable_part_swapping: 'bool | None' = None, jumpers_visible: 'bool | None' = True, component_kind: 'ComponentKind' = <ComponentKind.STANDARD: 0>, guid: 'uuid.UUID | None' = None, locked: 'bool' = False) -> 'int'
methodadd_component_body(self, body: 'AltiumPcbComponentBody', *, component_index: 'int | None' = None, guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"
methodadd_component_pad_mask_shape(self, component_index: 'int', designator: 'str', *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike', occurrence: 'int' = 0, hole_points_mils: 'list[list[tuple[float, float]]] | None' = None, outline_vertices: 'Sequence[PcbExtendedVertex] | None' = None, slot: 'PcbPadMaskShapeSlot | None' = None) -> "'PcbDocBuilder'"Give a placed component's pad its own shape on a paste or solder mask
methodadd_component_texts(self, component_index: 'int | None' = None) -> 'list[int]'Give a component, or every component, the Designator and Comment Texts
methodadd_custom_pad(self, *, designator: 'str', position_mils: 'tuple[float, float]', outline_points_mils: 'Sequence[tuple[float, float] | PcbRegionOutlineVertex]', layer: 'int | PcbLayer' = <PcbLayer.TOP: 1>, offset_mils: 'tuple[float, float]' = (0.0, 0.0), anchor_diameter_mils: 'float' = 1.0, anchor_width_mils: 'float | None' = None, anchor_height_mils: 'float | None' = None, anchor_rotation_degrees: 'float' = 0.0, anchor_shape: 'int | str | PadShape' = <PadShape.CIRCLE: 1>, pad_index: 'int | None' = None, hole_points_mils: 'list[list[tuple[float, float]]] | None' = None, outline_vertices: 'Sequence[PcbExtendedVertex] | None' = None, outline_points_are_local: 'bool' = True, layer_shapes: 'Sequence[PcbCustomPadLayerShapeSpec] | None' = None, net: 'str | AltiumPcbNet | None' = None, hole_size_mils: 'float' = 0.0, plated: 'bool | None' = None, slot_length_mils: 'float' = 0.0, slot_rotation_degrees: 'float' = 0.0, hole_shape: 'int | str' = 'round', hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, solder_mask_expansion: 'PcbMaskExpansionInput' = None, solder_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, paste_mask_expansion_mils: 'float | None' = None, component_index: 'int | None' = None, anchor_mid_shape: 'int | str | PadShape | None' = None, anchor_mid_width_mils: 'float | None' = None, anchor_mid_height_mils: 'float | None' = None, anchor_bottom_shape: 'int | str | PadShape | None' = None, anchor_bottom_width_mils: 'float | None' = None, anchor_bottom_height_mils: 'float | None' = None, anchor_layer: 'int | PcbLayer | None' = None, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None, body_guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"Add a custom pad using the native PcbDoc anchor-pad plus region shape.
methodadd_differential_pair(self, *, name: 'str', positive_net_name: 'str', negative_net_name: 'str', gather_control: 'bool' = False, create_missing_nets: 'bool' = True, unique_id: 'str | None' = None) -> "'PcbDocBuilder'"Add or update one `DifferentialPairs6/Data` pair object.
methodadd_dimension_record(self, *, record_type: 'int', record_payload: 'bytes | bytearray | memoryview', record_leader: 'int' = 0) -> 'AltiumPcbDimension'Add a raw Dimensions6 record while preserving typed parse/readback.
methodadd_embedded_font(self, *, name: 'str', font_data: 'bytes', style: 'str' = '', data_is_compressed: 'bool' = False, face_name: 'str | None' = None, bold: 'bool | None' = None, italic: 'bool | None' = None) -> "'PcbDocBuilder'"
methodadd_embedded_font_record(self, raw_record: 'bytes') -> "'PcbDocBuilder'"Append one native ``EmbeddedFonts6/Data`` record.
methodadd_embedded_model(self, *, name: 'str', model_data: 'bytes', model_id: 'uuid.UUID | str | None' = None, rotation_x_degrees: 'float' = 0.0, rotation_y_degrees: 'float' = 0.0, rotation_z_degrees: 'float' = 0.0, z_offset_mil: 'float' = 0.0, checksum: 'int | None' = None, model_source: 'str' = 'Undefined', data_is_compressed: 'bool' = False) -> 'AltiumPcbModel'Add an embedded 3D model payload to the board.
methodadd_extended_primitive_information(self, item: 'AltiumPcbExtendedPrimitiveInformation') -> "'PcbDocBuilder'"
methodadd_fill(self, pos1_mils: 'tuple[float, float]', pos2_mils: 'tuple[float, float]', *, rotation_degrees: 'float' = 0.0, layer: 'PcbLayerLike' = 'Top Layer', net: 'str | AltiumPcbNet | None' = None, component_index: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"
methodadd_mask_record(self, primitive_object_id: 'str', index: 'int', *, solder_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None) -> "'PcbDocBuilder'"Save one board primitive's own solder- and paste-mask modes.
methodadd_net(self, name: 'str', *, preferred_width_mils: 'float' = 10.0, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None) -> "'PcbDocBuilder'"Add a net unless one of that name (trimmed, any case) exists, which
methodadd_pad(self, *, designator: 'str', position_mils: 'tuple[float, float]', width_mils: 'float', height_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP: 1>, shape: 'int | str | PadShape' = <PadShape.RECTANGLE: 2>, rotation_degrees: 'float' = 0.0, hole_size_mils: 'float' = 0.0, plated: 'bool | None' = None, net: 'str | AltiumPcbNet | None' = None, corner_radius_percent: 'int | float | None' = None, top_shape: 'int | str | PadShape | None' = None, top_width_mils: 'float | None' = None, top_height_mils: 'float | None' = None, mid_shape: 'int | str | PadShape | None' = None, mid_width_mils: 'float | None' = None, mid_height_mils: 'float | None' = None, bottom_shape: 'int | str | PadShape | None' = None, bottom_width_mils: 'float | None' = None, bottom_height_mils: 'float | None' = None, pad_mode: 'int | None' = None, slot_length_mils: 'float' = 0.0, slot_rotation_degrees: 'float' = 0.0, hole_shape: 'int | str' = 'round', solder_mask_expansion: 'PcbMaskExpansionInput' = None, solder_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion: 'PcbMaskExpansionInput' = None, paste_mask_expansion_mode: 'PcbMaskExpansionModeInput | None' = None, paste_mask_expansion_mils: 'float | None' = None, hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, is_test_fab_top: 'bool' = False, is_test_fab_bottom: 'bool' = False, is_assy_testpoint_top: 'bool' = False, is_assy_testpoint_bottom: 'bool' = False, component_index: 'int | None' = None, solder_mask_expansion_bottom_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None) -> "'PcbDocBuilder'"
methodadd_polygon(self, *, outline_vertices: 'list[PcbPolygonVertex]', layer: 'int | str | PcbLayer' = <PcbLayer.TOP: 1>, cutout_vertices: 'list[list[PcbPolygonVertex]] | None' = None, net: 'str | None' = None, name: 'str' = '', polygon_type: 'str' = 'Polygon', track_width_mils: 'float' = 10.0, hatch_style: 'str' = 'Solid', arc_resolution_mils: 'float' = 0.5, remove_dead: 'bool' = True, remove_necks: 'bool' = True, area_threshold: 'float' = 250000000000.0, pour_over_style: 'int | None' = None, pour_index: 'int' = 0, union_index: 'int' = 0, raw_record: 'dict[str, object] | None' = None) -> "'PcbDocBuilder'"Add an editable Altium polygon-pour definition.
methodadd_region(self, *, outline_points_mils: 'list[tuple[float, float]]', layer: 'PcbLayerLike' = <PcbLayer.TOP: 1>, hole_points_mils: 'list[list[tuple[float, float]]] | None' = None, outline_vertices: 'Sequence[PcbExtendedVertex] | None' = None, is_keepout: 'bool' = False, keepout_restrictions: 'int' = 0, net: 'str | AltiumPcbNet | None' = None, component_index: 'int | None' = None, polygon_index: 'int | None' = None, subpoly_index: 'int' = -1, union_index: 'int' = 0, region_kind: 'int | PcbRegionKind' = <PcbRegionKind.COPPER: 0>, is_board_cutout: 'bool' = False, is_shapebased: 'bool' = False, cavity_height_mils: 'float' = 0.0, v7_layer: 'str | None' = None, guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"
methodadd_text(self, *, text: 'str', position_mils: 'tuple[float, float]', height_mils: 'float', layer: 'PcbLayerLike' = <PcbLayer.TOP_OVERLAY: 33>, rotation_degrees: 'float' = 0.0, stroke_width_mils: 'float' = 10.0, font_kind: 'str' = 'stroke', stroke_font_type: 'int | str' = 'default', font_name: 'str' = 'Arial', bold: 'bool' = False, italic: 'bool' = False, is_comment: 'bool' = False, is_designator: 'bool' = False, is_mirrored: 'bool' = False, is_inverted: 'bool' = False, inverted_margin_mils: 'float' = 0.0, use_inverted_rectangle: 'bool' = False, inverted_rectangle_size_mils: 'tuple[float, float] | None' = None, is_frame: 'bool' = False, frame_size_mils: 'tuple[float, float] | None' = None, text_justification: 'int | None' = None, barcode_kind: 'int' = 0, barcode_render_mode: 'int' = 1, barcode_full_size_mils: 'tuple[float, float] | None' = None, barcode_margin_mils: 'tuple[float, float]' = (20.0, 20.0), barcode_min_width_mils: 'float' = 0.0, barcode_show_text: 'bool' = True, barcode_inverted: 'bool' = True, component_index: 'int | None' = None, guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"Add a PCB text primitive at the given position.
methodadd_track(self, start_mils: 'tuple[float, float]', end_mils: 'tuple[float, float]', *, width_mils: 'float', layer: 'PcbLayerLike' = 'Top Layer', net: 'str | AltiumPcbNet | None' = None, component_index: 'int | None' = None, solder_mask_expansion_mils: 'float | None' = None, paste_mask_expansion_mils: 'float | None' = None, guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"
methodadd_via(self, *, position_mils: 'tuple[float, float]', diameter_mils: 'float', hole_size_mils: 'float', layer_start: 'PcbLayerLike' = <PcbLayer.TOP: 1>, layer_end: 'PcbLayerLike' = <PcbLayer.BOTTOM: 32>, net: 'str | AltiumPcbNet | None' = None, ipc4761_via_type: 'int | PcbIpc4761ViaType' = <PcbIpc4761ViaType.NONE: 0>, ipc4761_features: 'Sequence[AltiumPcbViaStructureFeature] | None' = None, propagation_delay_ps: 'float | None' = None, hole_positive_tolerance_mils: 'float | None' = None, hole_negative_tolerance_mils: 'float | None' = None, is_tent_top: 'bool' = False, is_tent_bottom: 'bool' = False, solder_mask_expansion_top_mils: 'float | None' = None, solder_mask_expansion_bottom_mils: 'float | None' = None, solder_mask_expansion: 'PcbMaskExpansionInput' = None, is_test_fab_top: 'bool' = False, is_test_fab_bottom: 'bool' = False, is_assy_testpoint_top: 'bool' = False, is_assy_testpoint_bottom: 'bool' = False, component_index: 'int | None' = None, guid: 'uuid.UUID | None' = None, drill_layer_pair_type: 'int | PcbDrillPairKind' = <PcbDrillPairKind.REGULAR: 0>, tents_by_rule: 'bool' = True) -> "'PcbDocBuilder'"
methodbuild_streams(self) -> 'dict[str, bytes]'
propertycustom_mask_shapes -> 'tuple[PcbCustomMaskShape, ...]'The board's ``CustomMaskShapes`` records as the builder writes them.
methodfilename(self) -> 'str'
methodfilepath(self) -> 'Path'
classmethodfrom_bytes(cls, data: 'bytes', filename: 'str | Path' = 'embedded.PcbDoc') -> "'PcbDocBuilder'"
methodget_mechanical_layer_kind(self, layer: 'int | str | PcbLayer') -> 'MechanicalLayerKind | None'Return the configured kind for a mechanical layer, if present.
methodhas_stream(self, stream_name: 'str') -> 'bool'
methodis_open(self) -> 'bool'
propertymechanical_layer_kinds -> 'Mapping[int, MechanicalLayerKind]'Return the current mapping by LayerKindMapping/Data layer id.
methodplace_component(self, footprint: "'AltiumPcbFootprint'", *, designator: 'str', position_mils: 'tuple[float, float]', layer: 'str | PcbLayer | int' = 'TOP', rotation_degrees: 'float' = 0.0, source_footprint_library: 'str' = '', comment_text: 'str | None' = None, comment_visible: 'bool' = False, component_parameters: 'dict[str, str] | None' = None, source_pcblib: "'AltiumPcbLib | None'" = None, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None, pads: 'Sequence[PcbPadOccurrence | None]' = (), members: 'Sequence[PcbMemberOccurrence]' = (), pad_nets: 'Mapping[str, AltiumPcbNet | str] | None' = None, locked_vias: 'Sequence[int]' = ()) -> 'PcbPlacedComponent'Place a footprint as `place_footprint` does, each member with its own
methodplace_footprint(self, footprint: "'AltiumPcbFootprint'", *, designator: 'str', position_mils: 'tuple[float, float]', layer: 'str | PcbLayer | int' = 'TOP', rotation_degrees: 'float' = 0.0, source_footprint_library: 'str' = '', comment_text: 'str | None' = None, comment_visible: 'bool' = False, component_parameters: 'dict[str, str] | None' = None, pad_nets: 'dict[str, str] | None' = None, source_pcblib: "'AltiumPcbLib | None'" = None) -> 'int'
methodread_stream(self, stream_name: 'str') -> 'bytes'
methodremove_component_parameter(self, component_index: 'int', name: 'str') -> "'PcbDocBuilder'"
methodremove_mechanical_layer_pairs_for(self, layers: 'Collection[int | str | PcbLayer]') -> "'PcbDocBuilder'"Remove all ``MECHPAIR*`` records referencing any layer in ``layers`` and compact indices.
methodremove_stream(self, stream_name: 'str') -> "'PcbDocBuilder'"
methodsave(self, filepath: 'Path') -> 'Path'Build the PCB document streams and write them to disk.
methodset_2d_current_layer(self, layer_token: 'str') -> "'PcbDocBuilder'"
methodset_3d_silkscreen_colors(self, *, top_color: 'int | None' = None, bottom_color: 'int | None' = None) -> "'PcbDocBuilder'"Set the saved 3D view's silkscreen colors (COLORREF, red low byte).
methodset_3d_solder_mask_colors(self, *, top_color: 'int | None' = None, bottom_color: 'int | None' = None) -> "'PcbDocBuilder'"
methodset_advanced_placer_place_large_clear(self, value: 'str') -> "'PcbDocBuilder'"
methodset_advanced_placer_use_advanced_place(self, value: 'bool') -> "'PcbDocBuilder'"
methodset_board_outline(self, outline: 'AltiumBoardOutline') -> "'PcbDocBuilder'"Replace the board outline with explicit line/arc outline geometry.
methodset_component_description(self, component_index: 'int', description: 'str') -> "'PcbDocBuilder'"
methodset_component_parameter(self, component_index: 'int', name: 'str', value: 'str') -> "'PcbDocBuilder'"
methodset_config_2d_full_filename(self, value: 'str') -> "'PcbDocBuilder'"
methodset_config_3d_full_filename(self, value: 'str') -> "'PcbDocBuilder'"
methodset_constraint_manager_token(self, token: 'str') -> "'PcbDocBuilder'"
methodset_current_view_state(self, value: 'str | PcbDocViewState') -> "'PcbDocBuilder'"
methodset_design_rule_checker_max_violation_count(self, value: 'int') -> "'PcbDocBuilder'"
methodset_design_rule_checker_verify_shorting_copper(self, value: 'bool') -> "'PcbDocBuilder'"
methodset_layer_stack_document(self, document: "'AltiumLayerStackDocument'") -> "'PcbDocBuilder'"Apply a typed layer-stack document to a newly authored board.
methodset_layer_stack_template(self, template: 'PcbDocLayerStackTemplate | str') -> "'PcbDocBuilder'"
methodset_mechanical_layer(self, layer: 'int | str | PcbLayer', *, name: 'str | None' = None, enabled: 'bool' = True, used_by_prims: 'bool | None' = None) -> "'PcbDocBuilder'"Set a mechanical layer display name and enabled state.
methodset_mechanical_layer_kind(self, layer: 'int | str | PcbLayer', kind: 'int | str | MechanicalLayerKind') -> "'PcbDocBuilder'"Set the semantic kind assigned to a mechanical layer.
methodset_mechanical_layer_pair(self, layer_1: 'int | str | PcbLayer', layer_2: 'int | str | PcbLayer', *, pair_index: 'int | None' = None) -> "'PcbDocBuilder'"Define a mechanical mirror pair used by component side flipping.
methodset_origin_mils(self, x_mils: 'float', y_mils: 'float') -> "'PcbDocBuilder'"Set the board origin in mils.
methodset_origin_to_outline_lower_left(self) -> "'PcbDocBuilder'"Derive the board origin from the outline's lower-left bounds.
methodset_outline_circle_mils(self, *, center_mils: 'tuple[float, float]', diameter_mils: 'float', vertex_count: 'int' = 64) -> "'PcbDocBuilder'"Approximate a circular board outline with evenly spaced vertices.
methodset_outline_rectangle_mils(self, left: 'float', bottom: 'float', right: 'float', top: 'float') -> "'PcbDocBuilder'"Set the board outline to an axis-aligned rectangle in mils.
methodset_outline_vertices_mils(self, vertices_mils: 'Sequence[tuple[float, float]]') -> "'PcbDocBuilder'"Replace the board outline with an explicit polygon in mils.
methodset_pad_via_library_cache_display_units(self, value: 'int') -> "'PcbDocBuilder'"
methodset_pad_via_library_display_units(self, value: 'int') -> "'PcbDocBuilder'"
methodset_pad_via_library_name(self, value: 'str') -> "'PcbDocBuilder'"
methodset_pin_swap_crossover_ratio(self, value: 'int') -> "'PcbDocBuilder'"
methodset_pin_swap_via_penalty_state(self, value: 'bool') -> "'PcbDocBuilder'"
methodset_sheet_frame_mils(self, x_mils: 'float', y_mils: 'float', width_mils: 'float', height_mils: 'float') -> "'PcbDocBuilder'"
methodset_signal_class_kind(self, value: 'int') -> "'PcbDocBuilder'"
methodset_signal_class_name(self, value: 'str') -> "'PcbDocBuilder'"
methodset_signal_class_unique_id(self, value: 'str') -> "'PcbDocBuilder'"
methodset_stream(self, stream_name: 'str', data: 'bytes') -> "'PcbDocBuilder'"
methodset_stream_same_size(self, stream_name: 'str', data: 'bytes') -> "'PcbDocBuilder'"
methodset_viewport_bounds(self, lx: 'int', hx: 'int', ly: 'int', hy: 'int') -> "'PcbDocBuilder'"
methodstream_names(self) -> 'list[str]'
methodstream_size(self, stream_name: 'str') -> 'int'
class

PcbDrawingOutput

from altium_monkey.altium_outjob import PcbDrawingOutput
class PcbDrawingOutput(document_path: 'str' = '', output_name: 'str' = 'PCB Drawing', page_options: 'str' = 'Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=Letter|PaperIndex=1') -> 'None'

Typed PCB drawing output definition.

Members (1)
KindSignatureSummary
methodto_spec(self) -> 'OutJobOutputSpec'
class

PcbEmbeddedBoardArraySpec

from altium_monkey.altium_pcb_embedded_board_authoring import PcbEmbeddedBoardArraySpec
class PcbEmbeddedBoardArraySpec(document_path: 'str', x: 'int', y: 'int', rotation_degrees: 'float' = 0.0, mirror: 'bool' = False, rows: 'int' = 1, columns: 'int' = 1, row_pitch: 'int' = 0, column_pitch: 'int' = 0, origin_mode: 'int' = <PcbEmbeddedBoardOriginMode.BOTTOM_LEFT: 1>, layer_token: 'str' = 'TOP', layer_v7_token: 'str | None' = None, untransmitted_layers: 'tuple[int, ...]' = (), transmit_drill_table: 'bool' = True, transmit_board_shape: 'bool' = True, transmit_dimensions: 'bool' = True, transmit_layer_stack_table: 'bool' = True, title_font_name: 'str' = 'Arial Narrow') -> 'None'

What one authored embedded board array record stores.

Lengths are Altium internal units (1e-4 mil). `layer_token` is the record's LAYER text and `layer_v7_token` its LAYER_V7 text, saved only for a layer with no legacy number (Mechanical 17 and up). `untransmitted_layers` are V7 layer ids of child layers left out of the panel. A transmit flag is written only when False, as Altium saves it.

class

PcbEmbeddedBoardDiagnostic

from altium_monkey.altium_pcb_embedded_board import PcbEmbeddedBoardDiagnostic
class PcbEmbeddedBoardDiagnostic(code: 'PcbEmbeddedBoardDiagnosticCode', severity: 'PcbEmbeddedBoardDiagnosticSeverity', record_index: 'int', field: 'str', message: 'str') -> 'None'

One field of one record that could not be read as Altium stores it.

class

PcbEmbeddedBoardSource

from altium_monkey.altium_pcb_embedded_board import PcbEmbeddedBoardSource
class PcbEmbeddedBoardSource(record_index: 'int', kind: 'PcbEmbeddedBoardKind', is_viewport: 'bool | None', document_path: 'str | None', placement_layer_token: 'str | None', x: 'int | None', y: 'int | None', rotation_degrees: 'float | None', rotation_text: 'str | None', mirror: 'bool | None', rows: 'int | None', columns: 'int | None', row_pitch: 'int | None', column_pitch: 'int | None', origin_mode: 'int | None', origin_anchor: 'PcbEmbeddedBoardOriginMode | None', transmit_layers: 'tuple[tuple[int, bool], ...]', transmit_drill_table: 'bool | None', transmit_board_shape: 'bool | None', transmit_dimensions: 'bool | None', transmit_layer_stack_table: 'bool | None', cached_extent: 'tuple[int, int, int, int] | None', keepout: 'bool | None', viewport: 'PcbEmbeddedBoardViewport', untyped_fields: 'tuple[tuple[str, str], ...]', diagnostics: 'tuple[PcbEmbeddedBoardDiagnostic, ...]') -> 'None'

The typed fields of one EmbeddedBoards6 record.

Coordinates and pitches are Altium internal units (1e-4 mil, signed 32-bit); the rotation is Altium's double in degrees. A field is None when the record does not store it or stores text Altium's reader does not take; `diagnostics` names each such field. `cached_extent` (X1..Y2) is Altium's saved array rectangle, a cache that placement never reads. The transmit flags are TRUE when absent, as Altium saves only FALSE ones. `untyped_fields` keeps every other pair, in record order.

Members (2)
KindSignatureSummary
propertyreference -> 'tuple[int, int] | None'X, Y: where the origin-mode anchor of the first copy lands.
propertyuntransmitted_layers -> 'tuple[int, ...]'V7 layer ids of the child layers TRANSMITLAYERS leaves out.
class

PcbEmbeddedBoardViewport

from altium_monkey.altium_pcb_embedded_board import PcbEmbeddedBoardViewport
class PcbEmbeddedBoardViewport(rect: 'tuple[int, int, int, int] | None', scale: 'float | None', visible: 'bool | None', title: 'str | None', title_font_name: 'str | None', title_font_size: 'int | None', title_font_color: 'int | None', visible_layers: 'str | None') -> 'None'

The viewport properties every record stores.

Lengths are internal units (1e-4 mil). `visible_layers` is the stored layer-set text. Each value is None when absent or unreadable.

class

PcbEnvelopeRow

from altium_monkey.altium_pcb_layer_context import PcbEnvelopeRow
class PcbEnvelopeRow(row: 'PcbContextPhysicalRow', z_top_nm: 'int', z_bottom_nm: 'int') -> 'None'

One row of a substack envelope and its depth.

class

PcbExtendedVertex

from altium_monkey import PcbExtendedVertex
class PcbExtendedVertex() -> 'None'

Extended vertex format with arc support.

Used in ShapeBasedRegions6 for outline vertices. Total size: 37 bytes per vertex.

Members (6)
KindSignatureSummary
propertycenter_x_mils -> 'float'Arc center X in mils.
propertycenter_y_mils -> 'float'Arc center Y in mils.
propertyis_round -> 'bool'False=line segment, True=arc.
propertyradius_mils -> 'float'Arc radius in mils.
propertyx_mils -> 'float'X position in mils.
propertyy_mils -> 'float'Y position in mils.
class

PcbFootprintAssetDetails

from altium_monkey import PcbFootprintAssetDetails
class PcbFootprintAssetDetails(pattern: 'str' = '', occurrence: 'int' = 0, component_indices: 'tuple[int, ...]' = (), component_designators: 'tuple[str, ...]' = (), component_count: 'int' = 0, source_footprint_library: 'str' = '', pad_count: 'int' = 0, primitive_count: 'int' = 0) -> 'None'

Typed details for a PCB footprint extractable asset.

class

PcbLayerContext

from altium_monkey.altium_pcb_layer_context import PcbLayerContext
class PcbLayerContext(_layers: 'tuple[PcbContextLayer, ...]', _by_ref: 'Mapping[PcbLayerRef, int]', _by_token: 'Mapping[str, PcbLayerLookup[int]]', _multilayer: 'int', _substacks: 'tuple[PcbContextSubstack, ...]', _substack_index: 'tuple[_SubstackIndex, ...]', _primary: 'int | None', _regions: 'tuple[PcbContextBoardRegion, ...]', _drill_pairs: 'tuple[PcbContextDrillPair, ...]', _diagnostics: 'tuple[PcbLayerDiagnostic, ...]', _registry: 'PcbLayerRegistry' = <factory>, _resolved_stack: 'ResolvedLayerStack | None' = None, _physical_rows: 'tuple[PcbContextPhysicalRow, ...]' = (), _envelopes: 'tuple[PcbSubstackEnvelope, ...]' = ()) -> 'None'

The document's one layer context.

Built once per document and cached on it; use `AltiumPcbDoc.layers()` or `AltiumPcbLib.layers()` rather than constructing it directly.

Members (35)
KindSignatureSummary
methodboard_region(self, region_id: 'int') -> 'PcbContextBoardRegion'
methodboard_region_by_name(self, name: 'str') -> 'PcbLayerLookup[int]'The region named `name`; several regions of one name are ambiguous.
propertyboard_regions -> 'tuple[PcbContextBoardRegion, ...]'
methodby_token(self, token: 'str') -> 'PcbLayerLookup[int]'The layer a configuration token or display name names.
methodcavity_side(self, layer_id: 'int', substack_id: 'int') -> 'PcbLayerLookup[PcbLayerFace]'The side of a substack's copper layer that opens on a cavity in it.
methodcomponent_mount(self, component: 'object') -> 'PcbLayerLookup[PcbLayerMount]'Where a parsed `AltiumPcbComponent` mounts, by its layer and position.
methodcoverlay_outline(self, layer_id: 'int') -> 'tuple[int, PcbLayerFace] | None'The substack and face a coverlay outline layer belongs to.
propertydiagnostics -> 'tuple[PcbLayerDiagnostic, ...]'What the context could not resolve.
propertydrill_pairs -> 'tuple[PcbContextDrillPair, ...]'
methoddrill_pairs_through(self, layer_id: 'int', substack_id: 'int') -> 'tuple[PcbContextDrillPair, ...]'The drill pairs that hold a copper layer in a substack.
methodenabled_in(self, layer_id: 'int', region_id: 'int') -> 'bool'Whether a layer exists in a board region's substack.
methodenvelope(self, substack_id: 'int') -> 'PcbSubstackEnvelope'A substack's physical rows, top to bottom, and their depths.
methodface(self, layer_id: 'int', substack_id: 'int') -> 'PcbLayerFace | None'Where a layer sits in a substack.
methodhole_span(self, pair: 'PcbContextDrillPair', substack_id: 'int') -> 'tuple[int, ...]'The copper layers a drill pair passes through within a substack.
methodlayer(self, layer_id: 'int') -> 'PcbContextLayer'
methodlayer_metadata(self, ref: 'PcbLayerRef') -> 'PcbLayerMetadata | None'Id, key, name, token, kind and side of a layer, for renderers.
propertylayers -> 'tuple[PcbContextLayer, ...]'Every layer, in stack order.
methodmount(self, ref: 'PcbLayerRef', x_mils: 'float', y_mils: 'float') -> 'PcbLayerLookup[PcbLayerMount]'Where an object on `ref` at a point mounts.
propertymultilayer -> 'int'The logical MultiLayer of through pads and vias.
methodopposite(self, layer_id: 'int', substack_id: 'int') -> 'int | None'The layer in the mirrored position within a substack.
methodphysical_row(self, row_id: 'int') -> 'PcbContextPhysicalRow'
propertyphysical_rows -> 'tuple[PcbContextPhysicalRow, ...]'Every physical row of the board's stack, top to bottom.
methodphysical_side(self, layer_id: 'int', substack_id: 'int') -> 'PcbLayerFace | None'The board face of a layer within a substack.
propertyprimary -> 'int | None'The board's main substack.
methodregion_at(self, x_mils: 'float', y_mils: 'float') -> 'int | None'The board region a point lies in, holes excluded.
propertyregistry -> 'PcbLayerRegistry'The board or library layer registry the context was built from.
methodresolve(self, ref: 'PcbLayerRef') -> 'PcbLayerLookup[int]'The layer an identity names.
methodside_of(self, layer_id: 'int') -> 'PcbLayerFace | None'The board face a layer belongs to by its own identity.
methodsubstack(self, substack_id: 'int') -> 'PcbContextSubstack'
methodsubstack_at(self, x_mils: 'float', y_mils: 'float') -> 'int | None'The substack that applies at a point: its region's, else the primary.
methodsubstack_of_region(self, region_id: 'int') -> 'PcbLayerLookup[int]'The substack a board region's construction follows.
propertysubstacks -> 'tuple[PcbContextSubstack, ...]'
methodsurface_layers(self, substack_id: 'int', face: 'PcbLayerFace') -> 'PcbSurfaceLayers'The outer copper and the surface layers on one face of a substack.
methodvia_span(self, start: 'PcbLayerRef', end: 'PcbLayerRef') -> 'PcbLayerLookup[PcbBoardViaSpan]'The board span of a via whose record stores `start` and `end`.
methodvia_span_of(self, via: 'object') -> 'PcbLayerLookup[PcbBoardViaSpan]'The board span of a parsed `AltiumPcbVia`, from its stored bytes.
class

PcbLayerDiagnostic

from altium_monkey.altium_pcb_layer_context import PcbLayerDiagnostic
class PcbLayerDiagnostic(message: 'str') -> 'None'

Something the context could not resolve; the rest is still usable.

class

PcbLayerLookup

from altium_monkey.altium_pcb_layer_context import PcbLayerLookup
class PcbLayerLookup(status: 'PcbLayerLookupStatus', candidates: 'tuple[_T, ...]' = ()) -> 'None'

The result of a context lookup: a miss or an ambiguity is a value.

Members (3)
KindSignatureSummary
propertyfound -> '_T | None'The single answer, if there is exactly one.
classmethodnot_found(cls) -> 'PcbLayerLookup[_T]'
classmethodof(cls, values: 'Sequence[_T]') -> 'PcbLayerLookup[_T]'Found for one value, not found for none, ambiguous for several.
class

PcbLayerMetadata

from altium_monkey.altium_pcb_layer_context import PcbLayerMetadata
class PcbLayerMetadata(id: 'int', key: 'str', name: 'str', token: 'str', kind: 'PcbLayerKind', side: 'PcbLayerFace | None', family: 'PcbLayerFamily', legacy_layer_id: 'int | None', v7_saved_layer_id: 'int | None') -> 'None'

Per-layer metadata for renderers and reports.

class

PcbLayerMount

from altium_monkey.altium_pcb_layer_context import PcbLayerMount
class PcbLayerMount(layer: 'int', substack: 'int', face: 'PcbLayerFace') -> 'None'

Where an object mounts: its layer, the substack there, and the face.

class

PcbLayerRef

from altium_monkey import PcbLayerRef
class PcbLayerRef(family: 'PcbLayerFamily', token: 'str', signal_kind: 'PcbSignalLayerKind | None' = None, number: 'int | None' = None, legacy_layer: 'PcbLayer | None' = None, v7_saved_layer_id: 'int | None' = None, runtime_v7_layer_id: 'int | None' = None) -> 'None'

Stable identity for one PCB layer.

Members (11)
KindSignatureSummary
classmethodbottom(cls) -> "'PcbLayerRef'"
classmethodfrom_legacy(cls, layer: 'int | PcbLayer') -> "'PcbLayerRef'"
classmethodfrom_v7_saved_layer_id(cls, value: 'int') -> "'PcbLayerRef'"
classmethodinternal_plane(cls, number: 'int') -> "'PcbLayerRef'"
propertylegacy_layer_id -> 'int | None'Return the legacy TV6 layer id when this ref is losslessly legacy.
methodmatches(self, other: "'PcbLayerLike'") -> 'bool'Return whether `other` names this layer.
classmethodmechanical(cls, number: 'int') -> "'PcbLayerRef'"
classmethodmid_layer(cls, number: 'int') -> "'PcbLayerRef'"
classmethodparse(cls, token: 'str', *, allow_native_tokens: 'bool' = False) -> "'PcbLayerRef'"
methodrequire_legacy_layer(self) -> 'PcbLayer'Return the legacy TV6 enum or raise when this ref is V7-only.
classmethodtop(cls) -> "'PcbLayerRef'"
class

PcbLayerRegistry

from altium_monkey import PcbLayerRegistry
class PcbLayerRegistry(entries: 'tuple[PcbLayerRegistryEntry, ...]' = ()) -> 'None'

Query facade for board/library layer refs and display names.

Members (7)
KindSignatureSummary
methodcoerce(self, value: 'PcbLayerLike', *, allow_native_tokens: 'bool' = False) -> 'PcbLayerRef'
methodentries_for_display_name(self, name: 'str') -> 'tuple[PcbLayerRegistryEntry, ...]'
methodentry_for_ref(self, ref: 'PcbLayerRef') -> 'PcbLayerRegistryEntry | None'
methodref_for_legacy_layer(self, layer: 'int | PcbLayer') -> 'PcbLayerRef | None'
methodref_for_runtime_v7_layer_id(self, value: 'int') -> 'PcbLayerRef | None'
methodref_for_token(self, token: 'str') -> 'PcbLayerRef | None'
methodref_for_v7_saved_layer_id(self, value: 'int') -> 'PcbLayerRef | None'
class

PcbLayerRegistryEntry

from altium_monkey import PcbLayerRegistryEntry
class PcbLayerRegistryEntry(ref: 'PcbLayerRef', display_name: 'str', custom_name: 'str | None' = None, default_name: 'str | None' = None, semantic_key: 'str | None' = None, enabled: 'bool | None' = None, used_by_primitives: 'bool | None' = None, color: 'str | None' = None, stack_index: 'int | None' = None, signal_stack_position: 'int | None' = None, signal_layer_count: 'int | None' = None, side: 'str | None' = None, source_aliases: 'tuple[str, ...]' = (), source_keys: 'tuple[str, ...]' = ()) -> 'None'

Board/library layer context paired with a stable layer ref.

class

PcbLayerResolutionError

from altium_monkey import PcbLayerResolutionError
class PcbLayerResolutionError

Raised when a layer reference cannot be resolved without data loss.

class

PcbMaskExpansion

from altium_monkey import PcbMaskExpansion
class PcbMaskExpansion(mode: 'PcbMaskExpansionModeInput' = <PcbMaskExpansionMode.RULE: 1>, expansion_mils: 'float | None' = None) -> 'None'

Public pad mask-expansion authoring value.

`expansion_mils` is required for `MANUAL` and must be omitted for `NONE` and `RULE`.

Members (3)
KindSignatureSummary
classmethodmanual(cls, expansion_mils: 'float') -> "'PcbMaskExpansion'"Return a manual signed expansion value in mils.
classmethodnone(cls) -> "'PcbMaskExpansion'"Return raw mode zero; this does not reliably suppress Altium apertures.
classmethodrule(cls) -> "'PcbMaskExpansion'"Return a rule-driven mask-expansion setting.
class

PcbMemberOccurrence

from altium_monkey import PcbMemberOccurrence
class PcbMemberOccurrence(kind: 'MemberKind', index: 'int', net: 'NetArgument' = None, guid: 'uuid.UUID | None' = None) -> 'None'

What one placed footprint member other than a pad holds of its own.

Attributes: kind: `"track"`, `"arc"`, `"fill"`, `"region"`, `"via"`, `"text"` or `"body"`. index: The member's index among the footprint's records of `kind`; for `"text"`, among the placed Texts (the footprint's, then any designator or comment Text the placement adds). A custom pad's body Region takes none; its GUID goes in the pad's occurrence. net: The member's net, for copper (a track, arc, fill, region or via), added when the board holds none. guid: The member's `PrimitiveGuids` GUID; derived when `None` or zero.

class

PcbPadMaskShapeSlot

from altium_monkey import PcbPadMaskShapeSlot
class PcbPadMaskShapeSlot(shape: 'PadShapeInput' = <PadShape.CIRCLE: 1>, x_size_mils: 'float' = 0.0, y_size_mils: 'float' = 0.0, corner_radius_percent: 'int' = 50, x_offset_mils: 'float' = 0.0, y_offset_mils: 'float' = 0.0) -> 'None'

The slot a pad saves for one mask layer in its ``CustomMaskShapes`` record: ``SHAPE``, ``XSIZE`` and ``YSIZE``, ``CRPCT`` for a rounded rectangle, and the pad-local ``XOFFSET`` and ``YOFFSET`` when not zero.

Altium draws a slot's own shape nowhere; it removes the pad's own opening on the layer, so the Region beside it is what that layer draws. The default, ``PcbPadMaskShapeSlot.editor()``, is ``ROUND`` at 0 by 0, the slot Altium's editor saves beside a Region; ``PcbPadMaskShapeSlot.custom()``, ``CUSTOM`` at 0 by 0, is an explicit option. ``PadShape.CIRCLE`` saves ``ROUND``; a rounded rectangle's corners are 50 percent, a new pad's, unless ``corner_radius_percent`` sets them.

Members (3)
KindSignatureSummary
classmethodcustom(cls) -> "'PcbPadMaskShapeSlot'"``CUSTOM`` at 0 by 0, centred; drawn as ``editor()`` is.
classmethodeditor(cls) -> "'PcbPadMaskShapeSlot'"``ROUND`` at 0 by 0, centred: the slot Altium's editor saves
methodproperties(self, layer: 'PcbMaskShapeLayer') -> 'list[tuple[str, str]]'The slot's keys on ``layer``, without their ``SPM<n>.`` prefix.
class

PcbPadOccurrence

from altium_monkey import PcbPadOccurrence
class PcbPadOccurrence(net: 'NetArgument' = None, guid: 'uuid.UUID | None' = None, unique_id: 'str | None' = None, body_guids: 'Sequence[uuid.UUID | None]' = (), locked: 'bool' = False) -> 'None'

What one placed pad holds of its own.

Attributes: net: The pad's net (an `AltiumPcbNet` of the board, or a name, added when the board holds none), or `None` for none unless `pad_nets` nets it by number. guid: The pad's `PrimitiveGuids` GUID; derived when `None` or zero. unique_id: The pad's `UniqueIDPrimitiveInformation` ID, kept as given; derived when `None` or empty. body_guids: A custom pad's body GUIDs in the footprint's body order: its body Regions in the footprint's record order, whatever order the placement writes them in (a flipped pad's in stack order). locked: Place the pad locked; unlocked otherwise, as the placement places every footprint record.

class

PcbPlacedComponent

from altium_monkey import PcbPlacedComponent
class PcbPlacedComponent(component: 'AltiumPcbComponent', pads: 'list[AltiumPcbPad | None]' = <factory>, pad_bodies: 'list[list[AltiumPcbRegion | None]]' = <factory>, tracks: 'list[AltiumPcbTrack | None]' = <factory>, arcs: 'list[AltiumPcbArc | None]' = <factory>, fills: 'list[AltiumPcbFill | None]' = <factory>, regions: 'list[AltiumPcbRegion | None]' = <factory>, vias: 'list[AltiumPcbVia | None]' = <factory>, texts: 'list[AltiumPcbText | None]' = <factory>, bodies: 'list[AltiumPcbComponentBody | None]' = <factory>, notes: 'list[str]' = <factory>) -> 'None'

A placed component and its footprint's members as live records, at the footprint's own indexes. A custom pad's body Regions hold `None` in `regions`; `pad_bodies` holds, at each pad's index, its body Regions in the footprint's body order, `None` for a body the placement left out (a paste or solder mask body), and nothing for an ordinary pad. `notes` holds what the placement noted without refusing it.

class

PcbPolygonVertex

from altium_monkey import PcbPolygonVertex
class PcbPolygonVertex(x_mils: 'float', y_mils: 'float', kind: 'int' = 0, radius_mils: 'float' = 0.0, start_angle: 'float' = 0.0, end_angle: 'float' = 0.0, center_x_mils: 'float' = 0.0, center_y_mils: 'float' = 0.0, has_center: 'bool' = False) -> 'None'

Single vertex in polygon outline or cutout.

class

PcbPrimitiveLayerState

from altium_monkey import PcbPrimitiveLayerState
class PcbPrimitiveLayerState(ref: 'PcbLayerRef', stored_legacy_layer_id: 'int | None' = None, stored_v7_saved_layer_id: 'int | None' = None, stored_runtime_v7_layer_id: 'int | None' = None, stored_v7_layer_token: 'str | None' = None, source_field: 'str' = '') -> 'None'

Resolved primitive layer identity plus serialized storage diagnostics.

class

PcbRegionArc

from altium_monkey import PcbRegionArc
class PcbRegionArc(center_mils: 'tuple[float, float]', radius_mils: 'float | None' = None, start_angle_degrees: 'float | None' = None, end_angle_degrees: 'float | None' = None, clockwise: 'bool | None' = None) -> 'None'

A circular arc from its outline vertex to the next vertex, in mils.

Give either Altium's fields (`radius_mils`, `start_angle_degrees`, `end_angle_degrees`; Altium's arc runs counterclockwise from start to end) or the A0-style `clockwise` direction, from which the radius and angles follow from the two endpoints and the center.

class

PcbRegionOutlineVertex

from altium_monkey import PcbRegionOutlineVertex
class PcbRegionOutlineVertex(x_mils: 'float', y_mils: 'float', arc: 'PcbRegionArc | None' = None) -> 'None'

One Region outline vertex in mils; `arc` runs from it to the next vertex.

class

PcbRoutingContextParseFailure

from altium_monkey.altium_pcbdoc import PcbRoutingContextParseFailure
class PcbRoutingContextParseFailure(section: '_RoutingContextSection', error: 'Exception') -> 'None'

One original failure swallowed by a routing-context section's tolerant load.

class

PcbSimpleVertex

from altium_monkey import PcbSimpleVertex
class PcbSimpleVertex() -> 'None'

Simple vertex format (double precision coordinates).

Used for hole vertices in ShapeBasedRegions6. Total size: 16 bytes per vertex.

Members (2)
KindSignatureSummary
propertyx_mils -> 'float'X position in mils.
propertyy_mils -> 'float'Y position in mils.
class

PcbSmartUnionHeader

from altium_monkey.altium_pcb_via_pattern_unions import PcbSmartUnionHeader
class PcbSmartUnionHeader(union_index: 'int', layer: 'str' = 'TOP', locked: 'bool' = False, polygon_outline: 'bool' = False, user_routed: 'bool' = True, keepout: 'bool' = False, bounds: 'tuple[int, int, int, int]' = (0, 0, 0, 0), rotation: 'float' = 0.0, placeholder: 'tuple[int, int]' = (0, 0), primitives_locked: 'bool' = False, alignment: 'int' = 0, mirror: 'bool' = False) -> 'None'

The SmartUnion placeholder fields every via-pattern record opens with.

Lengths are internal units. `bounds` is X1, Y1, X2, Y2; Altium 26.10 rewrites it with the members' extent on save. `union_index` is the pattern's id: Altium reads it from `FUNIONINDEX` and its member vias hold it. Both `UNIONINDEX` and `FUNIONINDEX` are written from it.

Members (2)
KindSignatureSummary
classmethodfrom_items(cls, items: 'Sequence[PcbSmartUnionItem]', union_index: 'int') -> 'PcbSmartUnionHeader'The header section; `union_index` is used when it has no FUNIONINDEX.
methodto_items(self, kind: 'PcbSmartUnionKind') -> 'tuple[PcbSmartUnionItem, ...]'The header as Altium 26.10 writes it.
class

PcbSmartUnionTemplateVia

from altium_monkey.altium_pcb_via_pattern_unions import PcbSmartUnionTemplateVia
class PcbSmartUnionTemplateVia(items: 'tuple[PcbSmartUnionItem, ...]') -> 'None'

The template via a via pattern places, as its own parameter list.

`items` is the exact list Altium saved. Its keys repeat the header's (SELECTION, LAYER, UNIONINDEX, ...), so it is kept as its own section rather than read through the record's first-value lookup. `to_via()` decodes it into the ordinary `AltiumPcbVia` model; `from_via()` encodes one back.

Members (9)
KindSignatureSummary
propertydiameter_iu -> 'int'
propertyend_layer -> 'PcbLayer'
classmethodfrom_via(cls, via: 'AltiumPcbVia', union_index: 'int') -> 'PcbSmartUnionTemplateVia'Encode a via as a template, in Altium 26.10's key order.
propertyhole_size_iu -> 'int'
propertysolder_mask_expansion_mode -> 'str'
propertystart_layer -> 'PcbLayer'
propertytemplate_link -> 'tuple[str, str] | None'
methodto_via(self) -> 'AltiumPcbVia'The template as an ordinary via record at its saved position.
methodwith_union_index(self, union_index: 'int') -> 'PcbSmartUnionTemplateVia'The same template, owned by another union id.
class

PcbStepModelBounds

from altium_monkey import PcbStepModelBounds
class PcbStepModelBounds(bounds_mils: 'tuple[float, float, float, float]', overall_height_mils: 'float', min_z_mils: 'float', max_z_mils: 'float') -> 'None'

Axis-aligned STEP model bounds converted to PCB public mil units.

`bounds_mils` is the footprint-plane XY projection after model rotations and X/Y placement are applied. `overall_height_mils` follows Altium's 3D Body field and stores the transformed model `zmax` above the board plane.

class

PcbStructuralContractLimits

from altium_monkey import PcbStructuralContractLimits
class PcbStructuralContractLimits(max_input_bytes: 'int', max_output_bytes: 'int', max_json_depth: 'int', max_json_items: 'int', max_entries: 'int', max_stream_bytes: 'int', max_total_stream_bytes: 'int') -> 'None'

Required host-policy budgets; none are Altium format ceilings.

class

PcbSubstackEnvelope

from altium_monkey.altium_pcb_layer_context import PcbSubstackEnvelope
class PcbSubstackEnvelope(substack: 'int', thickness_nm: 'int', rows: 'tuple[PcbEnvelopeRow, ...]', complete: 'bool') -> 'None'

The physical rows of one substack, top to bottom, and their depths.

Local to the substack: no global board Z, fold or branch transform.

class

PcbSurfaceLayers

from altium_monkey.altium_pcb_layer_context import PcbSurfaceLayers
class PcbSurfaceLayers(copper: 'int | None' = None, solder_mask: 'int | None' = None, solder_paste: 'int | None' = None, overlay: 'int | None' = None, coverlay: 'int | None' = None) -> 'None'

The layers on one face of one substack.

class

PcbTextGeometrySession

from altium_monkey.altium_pcb_text_geometry import PcbTextGeometrySession
class PcbTextGeometrySession(pcbdoc: 'AltiumPcbDoc') -> 'None'

Realize one loaded Source board's text with per-acquisition resources.

Positions and dimensions come from the Source records in Altium internal units; existing result geometry is in millimeters. Actual font-byte evidence remains in TextPolygonResult.font_sources. Never reuse this session for a different board or a copied variant board with different component parameters.

Members (3)
KindSignatureSummary
staticmethodis_copper_text(text: 'AltiumPcbText') -> 'bool'Classify native signal/plane/multilayer text, excluding document aliases.
methodrender_text(self, text: 'AltiumPcbText', *, text_override: 'str | None' = None, layer_function: 'str | None' = None) -> 'StrokeTextResult | TextPolygonResult | None'Return existing numeric text products with the qualified import policy.
methodresolve_text(self, text: 'AltiumPcbText', *, project_parameters: 'dict[str, str] | None' = None) -> 'str'Resolve current text without mutating its owner or Source board.
class

PcbUnlinkedCustomPadBody

from altium_monkey import PcbUnlinkedCustomPadBody
class PcbUnlinkedCustomPadBody(section: "Literal['regions', 'shape_based_regions']", index: 'int', saved_pad_index: 'str', reason: 'PcbUnlinkedCustomPadBodyReason') -> 'None'

A Region or ShapeBasedRegion record whose saved PADINDEX names no pad of the board, or does not read.

Altium's link takes a primitive saved with a PadIndex out of the free primitives whether or not a pad takes it, so it draws such a record nowhere: not as a pad's shape, not as a free Region. Rust `PcbUnlinkedCustomPadBody`.

class

PcbViaShieldingOptions

from altium_monkey.altium_pcb_via_pattern_unions import PcbViaShieldingOptions
class PcbViaShieldingOptions(step: 'int', stagger: 'bool', net_name: 'str', via_pad_clearance: 'int', pullback: 'int', via_net_name: 'str' = '', distance: 'int' = 0, row_count: 'int' = 1, row_step: 'int' = 0, multiple_objects: 'bool' = False, add_copper: 'bool' = False, add_poly_cutout: 'bool' = False, shielded_objects: 'tuple[tuple[str, int], ...]' = (), check_rules_inside: 'bool' = False, via_pitch: 'int | None' = None, row_spacing: 'int | None' = None, keep_equal_via_pitch: 'bool' = False, fill_inner_area: 'bool' = False, via_pitch_positive_tolerance: 'int' = 0, via_pitch_negative_tolerance: 'int' = 0, via_offset: 'int' = 0, constraint_area: 'str' = '', template_layer_pairs: 'str' = '', optimize_via_pitch: 'bool' = False, is_constraint_area: 'bool' = False) -> 'None'

Via-shielding options.

The 26.x fields default as Altium 26.10 writes them for a file saved before they existed. `via_pitch` and `row_spacing` of None are not saved; 26.10 then writes the template diameter plus `step` and plus `row_step` respectively.

class

PcbViaShieldingUnion

from altium_monkey.altium_pcb_via_pattern_unions import PcbViaShieldingUnion
class PcbViaShieldingUnion(header: 'PcbSmartUnionHeader', options: 'PcbViaShieldingOptions', template_via: 'PcbSmartUnionTemplateVia', used_improved_rebuild: 'bool' = False, record_index: 'int | None' = None) -> 'None'

One via-shielding SmartUnion: its options and template.

Member vias are the ordinary vias whose native union index equals `union_index`.

Members (6)
KindSignatureSummary
propertyeffective_row_spacing -> 'int'`row_spacing`, or the template diameter plus `row_step` 26.10 writes.
propertyeffective_via_pitch -> 'int'`via_pitch`, or the template diameter plus `step` 26.10 writes.
classmethodfrom_record(cls, record: 'PcbSmartUnionRecord') -> 'PcbViaShieldingUnion | None'
methodmember_vias(self, vias: 'Sequence[AltiumPcbVia]') -> 'tuple[AltiumPcbVia, ...]'
methodto_items(self) -> 'tuple[PcbSmartUnionItem, ...]'The record as Altium 26.10 writes it.
propertyunion_index -> 'int'
class

PcbViaStitchingOptions

from altium_monkey.altium_pcb_via_pattern_unions import PcbViaStitchingOptions
class PcbViaStitchingOptions(step: 'int', stagger: 'bool', net_name: 'str', via_pad_clearance: 'int', pullback: 'int', offset_x: 'int' = 0, offset_y: 'int' = 0, check_rules_inside: 'bool' = False) -> 'None'

Via-stitching options.

class

PcbViaStitchingUnion

from altium_monkey.altium_pcb_via_pattern_unions import PcbViaStitchingUnion
class PcbViaStitchingUnion(header: 'PcbSmartUnionHeader', options: 'PcbViaStitchingOptions', template_via: 'PcbSmartUnionTemplateVia', constrain_area: 'bool' = True, area: 'tuple[PcbRegionNativeVertex, ...]' = (), used_improved_rebuild: 'bool' = False, record_index: 'int | None' = None) -> 'None'

One via-stitching SmartUnion: its options, template and area.

`area` is the stitched area outline (Altium's `SerializeAreaShape`); `constrain_area` is its ISCONSTRAINAREA flag. Member vias are the ordinary vias whose native union index equals `union_index`.

Members (4)
KindSignatureSummary
classmethodfrom_record(cls, record: 'PcbSmartUnionRecord') -> 'PcbViaStitchingUnion | None'
methodmember_vias(self, vias: 'Sequence[AltiumPcbVia]') -> 'tuple[AltiumPcbVia, ...]'
methodto_items(self) -> 'tuple[PcbSmartUnionItem, ...]'The record as Altium 26.10 writes it.
propertyunion_index -> 'int'
class

ResolvedLayer

from altium_monkey.altium_resolved_layer_stack import ResolvedLayer
class ResolvedLayer(layer_key: 'str', display_name: 'str', legacy_id: 'int | None' = None, v7_id: 'int | None' = None, v9_group: 'int | None' = None, stack_index: 'int | None' = None, thickness_mils: 'float' = 0.0, material: 'str | None' = None, layer_ref: 'PcbLayerRef | None' = None, family: 'str' = '', side: 'str | None' = None, registry_ref: 'str' = '', source_record_id: 'str' = '', physical_row: 'bool' = False) -> 'None'

Single resolved layer with stable ID and friendly display name.

class

ResolvedLayerEnvelopeRow

from altium_monkey.altium_resolved_layer_stack import ResolvedLayerEnvelopeRow
class ResolvedLayerEnvelopeRow(layer_key: 'str', display_name: 'str', family: 'str', stack_index: 'int | None', thickness_mils: 'float', z_top_mils: 'float', z_bottom_mils: 'float', z_center_mils: 'float') -> 'None'

One local-Z physical row inside a resolved substack envelope.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

ResolvedLayerStack

from altium_monkey.altium_resolved_layer_stack import ResolvedLayerStack
class ResolvedLayerStack(layers: 'tuple[ResolvedLayer, ...]', layer_names: 'tuple[str, ...]', legacy_id_to_name: 'dict[int, str]', standard_layer_names: 'dict[str, str]', v9_group_by_name: 'dict[str, int]', top_layer_name: 'str', bottom_layer_name: 'str', inner_signal_layers: 'tuple[str, ...]', mechanical_layer_names: 'tuple[str, ...]', drill_pairs: 'tuple[ResolvedDrillPair, ...]', drill_pair_layer_names: 'dict[tuple[int, int], tuple[str, str]]', substacks: 'tuple[ResolvedSubstack, ...]' = (), board_region_contexts: 'tuple[ResolvedBoardRegionContext, ...]' = ()) -> 'None'

Unified resolved layer stack for IPC and future consumers.

Deprecated view: use the document's layer context, `AltiumPcbDoc.layers()`. The instance a PcbDoc returns is the one its context was built from, so it is built once per document.

Members (20)
KindSignatureSummary
methodboard_region_context_by_name(self, name: 'str') -> 'ResolvedBoardRegionContext | None'Lookup resolved region context by board-region name.
methodboard_region_contexts_for_layerstack_id(self, layerstack_id: 'str') -> 'tuple[ResolvedBoardRegionContext, ...]'Return board regions bound to a given layerstack/substack GUID.
methoddisplay_name_for_token(self, token: 'str') -> 'str | None'Resolve display name from standard token or direct display name.
methoddrill_pairs_for_board_region(self, board_region_or_layerstack_id: 'Any') -> 'tuple[ResolvedDrillPair, ...]'Return drill spans valid for a board region or layerstack GUID.
methoddrill_pairs_for_substack(self, source_stackup_ref: 'str') -> 'tuple[ResolvedDrillPair, ...]'Return drill spans valid for the requested substack.
methodlayer_by_legacy_id(self, legacy_id: 'int') -> 'ResolvedLayer | None'Lookup layer by legacy primitive layer ID.
methodlayer_by_name(self, name: 'str') -> 'ResolvedLayer | None'Lookup layer by display name.
methodlayer_by_token(self, token: 'str') -> 'ResolvedLayer | None'Lookup layer by standard token or display-name token.
methodlayer_by_v7_id(self, v7_id: 'int') -> 'ResolvedLayer | None'Lookup layer by exact saved V7 layer ID.
methodlayer_enabled_for_board_region(self, layer_token_or_name: 'str | int', board_region_or_layerstack_id: 'Any') -> 'bool'Check whether a display-name/token/legacy-layer is enabled in a board region.
methodlayer_enabled_for_substack(self, layer_token_or_name: 'str | int', source_stackup_ref: 'str') -> 'bool'Check whether a display-name/token/legacy-layer is enabled in a substack.
methodlayers_for_board_region(self, board_region_or_layerstack_id: 'Any') -> 'tuple[ResolvedLayer, ...]'Return enabled physical layers for a board region or layerstack GUID.
methodlayers_for_substack(self, source_stackup_ref: 'str') -> 'tuple[ResolvedLayer, ...]'Return enabled physical layers for the requested substack.
methodresolve_layer_name(self, legacy_id: 'int') -> 'str'Resolve legacy layer ID to display name.
methodstack_envelope_for_board_region(self, board_region_or_layerstack_id: 'Any', *, include_zero_thickness_layers: 'bool' = False) -> 'ResolvedStackEnvelope | None'Return a substack-local Z envelope for a board region or layerstack GUID.
methodstack_envelope_for_substack(self, source_stackup_ref: 'str', *, include_zero_thickness_layers: 'bool' = False) -> 'ResolvedStackEnvelope | None'Return a substack-local Z envelope for enabled physical rows.
methodstandard_layer_name(self, token: 'str') -> 'str | None'Resolve a canonical standard token like TOPSOLDER or MID1.
methodsubstack_by_name(self, name: 'str') -> 'ResolvedSubstack | None'Lookup resolved substack by display name.
methodsubstack_by_source_ref(self, source_stackup_ref: 'str') -> 'ResolvedSubstack | None'Lookup resolved substack by native Altium stackup GUID.
methodsubstack_for_board_region(self, board_region_or_layerstack_id: 'Any') -> 'ResolvedSubstack | None'Resolve a substack from a board-region object or raw layerstack GUID.
class

ResolvedStackEnvelope

from altium_monkey.altium_resolved_layer_stack import ResolvedStackEnvelope
class ResolvedStackEnvelope(source_stackup_ref: 'str', substack_name: 'str', is_flex: 'bool | None', z_zero: 'str', total_thickness_mils: 'float', top_z_mils: 'float', bottom_z_mils: 'float', layers: 'tuple[ResolvedLayerEnvelopeRow, ...]' = ()) -> 'None'

Substack-local physical thickness envelope.

Coordinates are local to the substack. The zero plane is the midpoint of that substack's enabled positive-thickness physical rows. This object does not describe global board Z placement, folding, or branch transforms.

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupTextFeature

from altium_monkey import StackupTextFeature
class StackupTextFeature(id: 'str', name: 'str') -> 'None'

StackupTextFeature(id: 'str', name: 'str')

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXBranch

from altium_monkey import StackupXBranch
class StackupXBranch(name: 'str', description: 'str', parent_branch_id: 'str', sections: 'tuple[StackupXBranchSection, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>) -> 'None'

StackupXBranch(name: 'str', description: 'str', parent_branch_id: 'str', sections: 'tuple[StackupXBranchSection, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>)

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXBranchSection

from altium_monkey import StackupXBranchSection
class StackupXBranchSection(name: 'str', parent_section_id: 'str', stacks: 'tuple[StackupXBranchSectionStack, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>) -> 'None'

StackupXBranchSection(name: 'str', parent_section_id: 'str', stacks: 'tuple[StackupXBranchSectionStack, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>)

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXBranchSectionStack

from altium_monkey import StackupXBranchSectionStack
class StackupXBranchSectionStack(layer_stack_id: 'str', description: 'str', material_usage: 'str', source: 'str', parent_layer_id: 'str', parent_layer_stack_id: 'str', source_layer_id: 'str', source_layer_stack_id: 'str', is_left_intrusions_linked: 'bool | None', intrusion_left_bottom: 'str', intrusion_left_top: 'str', is_right_intrusions_linked: 'bool | None', intrusion_right_bottom: 'str', intrusion_right_top: 'str', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>) -> 'None'

StackupXBranchSectionStack(layer_stack_id: 'str', description: 'str', material_usage: 'str', source: 'str', parent_layer_id: 'str', parent_layer_stack_id: 'str', source_layer_id: 'str', source_layer_stack_id: 'str', is_left_intrusions_linked: 'bool | None', intrusion_left_bottom: 'str', intrusion_left_top: 'str', is_right_intrusions_linked: 'bool | None', intrusion_right_bottom: 'str', intrusion_right_top: 'str', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>)

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXFeature

from altium_monkey import StackupXFeature
class StackupXFeature(id: 'str', name: 'str') -> 'None'

StackupXFeature(id: 'str', name: 'str')

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXImpedanceProfile

from altium_monkey import StackupXImpedanceProfile
class StackupXImpedanceProfile(auto_name: 'str', profile_type: 'str', impedance: 'str', tolerance: 'str', transmission_lines: 'tuple[StackupXTransmissionLine, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', custom_name: 'str | None' = None, *, id: 'str' = <factory>) -> 'None'

Impedance settings with a separate, optional decoded custom label.

Members (2)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
propertytransmission_line_count -> 'int'
class

StackupXLayer

from altium_monkey import StackupXLayer
class StackupXLayer(type_id: 'str', name: 'str', is_shared: 'bool | None', is_enabled: 'bool | None', is_stiffener: 'bool | None', is_adhesive: 'bool | None', properties: 'tuple[StackupXProperty, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>) -> 'None'

StackupXLayer(type_id: 'str', name: 'str', is_shared: 'bool | None', is_enabled: 'bool | None', is_stiffener: 'bool | None', is_adhesive: 'bool | None', properties: 'tuple[StackupXProperty, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>)

Members (5)
KindSignatureSummary
propertyfamily -> 'str'
propertyproperty_map -> 'dict[str, StackupXProperty]'
methodproperty_value(self, name: 'str') -> 'str'
propertythickness_mils -> 'float | None'
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXProperty

from altium_monkey import StackupXProperty
class StackupXProperty(name: 'str', type_name: 'str', value: 'str') -> 'None'

StackupXProperty(name: 'str', type_name: 'str', value: 'str')

Members (2)
KindSignatureSummary
propertylength_mils -> 'float | None'
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXSpan

from altium_monkey import StackupXSpan
class StackupXSpan(auto_name: 'str', span_type: 'str', start_layer_id: 'str', stop_layer_id: 'str', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>) -> 'None'

StackupXSpan(auto_name: 'str', span_type: 'str', start_layer_id: 'str', stop_layer_id: 'str', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>)

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXStack

from altium_monkey import StackupXStack
class StackupXStack(name: 'str', stack_type: 'str', is_flex: 'bool | None', is_symmetric: 'bool | None', template_id: 'str', layers: 'tuple[StackupXLayer, ...]', via_spans: 'tuple[StackupXSpan, ...]', drill_spans: 'tuple[StackupXSpan, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>) -> 'None'

StackupXStack(name: 'str', stack_type: 'str', is_flex: 'bool | None', is_symmetric: 'bool | None', template_id: 'str', layers: 'tuple[StackupXLayer, ...]', via_spans: 'tuple[StackupXSpan, ...]', drill_spans: 'tuple[StackupXSpan, ...]', raw_attributes: 'tuple[tuple[str, str], ...]', *, id: 'str' = <factory>)

Members (3)
KindSignatureSummary
propertycopper_layer_names -> 'tuple[str, ...]'
propertylayer_names -> 'tuple[str, ...]'
methodto_debug_json(self) -> 'dict[str, object]'
class

StackupXTransmissionLine

from altium_monkey import StackupXTransmissionLine
class StackupXTransmissionLine(layer_id: 'str', stack_id: 'str', is_differential: 'bool | None', tl_type_name: 'str', calc_mode: 'str', top_ref_layer_id: 'str', bottom_ref_layer_id: 'str', trace_width: 'str', trace_gap: 'str', impedance_error: 'str', use_solder_mask: 'bool | None', coated_height_1: 'str', coated_height_2: 'str', clearance_to_plane: 'str', electric_parameters: 'tuple[tuple[str, str], ...]', raw_attributes: 'tuple[tuple[str, str], ...]') -> 'None'

StackupXTransmissionLine(layer_id: 'str', stack_id: 'str', is_differential: 'bool | None', tl_type_name: 'str', calc_mode: 'str', top_ref_layer_id: 'str', bottom_ref_layer_id: 'str', trace_width: 'str', trace_gap: 'str', impedance_error: 'str', use_solder_mask: 'bool | None', coated_height_1: 'str', coated_height_2: 'str', clearance_to_plane: 'str', electric_parameters: 'tuple[tuple[str, str], ...]', raw_attributes: 'tuple[tuple[str, str], ...]')

Members (1)
KindSignatureSummary
methodto_debug_json(self) -> 'dict[str, object]'
enum

AltiumComponentPlacement

from altium_monkey import AltiumComponentPlacement
enum AltiumComponentPlacement

Component placement policy for authored copper stack rows.

Altium stores this as an integer in native PcbDoc rows and as a typed StackupX property on export. Public authoring code should use these names instead of raw native integers.

Members (3)
KindSignatureSummary
memberNONE= 0
memberBODY_UP= 1
memberBODY_DOWN= 2
enum

AltiumDielectricLayerKind

from altium_monkey import AltiumDielectricLayerKind
enum AltiumDielectricLayerKind

Layer Stack Manager dielectric row kind for authored rigid stacks.

Members (3)
KindSignatureSummary
memberCORE= 0
memberPREPREG= 2
memberCOVERLAY= 4
enum

AltiumStackupRoughnessModel

from altium_monkey import AltiumStackupRoughnessModel
enum AltiumStackupRoughnessModel

Layer Stack Manager conductor roughness model.

Members (6)
KindSignatureSummary
memberNO_ROUGHNESS= 'NoRoughness'
memberMODIFIED_HAMMERSTAD= 'MHammerstad'
memberHURAY_SNOWBALL= 'HuraySnowball'
memberMODIFIED_GROISS= 'MGroiss'
memberHEMISPHERICAL= 'Hemispherical'
memberHURAY_BRACKEN= 'HurayBracken'
enum

AltiumStackupType

from altium_monkey import AltiumStackupType
enum AltiumStackupType

Layer Stack Manager stackup type.

Members (2)
KindSignatureSummary
memberSTANDARD= 'Standard'
memberPRINTED= 'Printed'
function

coerce_pcb_layer_ref

from altium_monkey import coerce_pcb_layer_ref
def coerce_pcb_layer_ref(value: 'PcbLayerLike', *, registry: 'PcbLayerRegistry | None' = None, allow_native_tokens: 'bool' = False) -> 'PcbLayerRef'

Coerce public layer input to a stable `PcbLayerRef`.

function

compute_altium_model_checksum

from altium_monkey import compute_altium_model_checksum
def compute_altium_model_checksum(model_data: 'bytes') -> 'int'

Compute Altium's native embedded PCB 3D model checksum.

The return value is the unsigned 32-bit value reported by Altium's model checksum and written to component-body model references. `Models/Data` stores the same bits as a signed 32-bit integer when needed.

function

compute_step_model_bounds_mils

from altium_monkey import compute_step_model_bounds_mils
def compute_step_model_bounds_mils(model_data: 'bytes | bytearray | memoryview | str | Path', *, filename_hint: 'str' = 'model.step', rotation_x_degrees: 'float' = 0.0, rotation_y_degrees: 'float' = 0.0, rotation_z_degrees: 'float' = 0.0, location_mils: 'tuple[float, float]' = (0.0, 0.0), z_offset_mils: 'float' = 0.0) -> 'PcbStepModelBounds'

Compute an Altium-style STEP model bounding box in PCB public mil units.

The helper imports the STEP payload through the `wn-geometer` runtime dependency, applies model rotations around the STEP origin in Altium order (X, then Y, then Z), then applies `location_mils` to XY and `z_offset_mils` to Z. The returned projection is an axis-aligned bounding rectangle, not an HLR outline.

Args: model_data: Uncompressed STEP payload bytes, or a path to a STEP file. filename_hint: Filename used in diagnostics and fallback staging when bytes are supplied. rotation_x_degrees: X-axis model rotation in degrees. rotation_y_degrees: Y-axis model rotation in degrees. rotation_z_degrees: Z-axis model rotation in degrees. location_mils: Footprint-plane model location `(x_mils, y_mils)`. z_offset_mils: 3D model Z offset in mils.

Returns: Bounds as `(left, bottom, right, top)`, `zmin`, `zmax`, and Altium Overall Height (`zmax` above the board plane), all in mils.

function

decode_pcb_keepout_restrictions

from altium_monkey import decode_pcb_keepout_restrictions
def decode_pcb_keepout_restrictions(mask: 'int') -> 'tuple[PcbKeepoutRestriction, ...]'

Return known keepout restriction flags set in ``mask``.

function

decode_pcbdoc_structural_json

from altium_monkey import decode_pcbdoc_structural_json
def decode_pcbdoc_structural_json(source: '_JSON_SOURCE', *, limits: 'PcbStructuralContractLimits') -> 'bytes'

Decode tagged or legacy PcbDoc structural JSON to validated OLE bytes.

function

decode_pcblib_structural_json

from altium_monkey import decode_pcblib_structural_json
def decode_pcblib_structural_json(source: '_JSON_SOURCE', *, limits: 'PcbStructuralContractLimits') -> 'bytes'

Decode tagged or legacy PcbLib structural JSON to validated OLE bytes.

function

embedded_board_array_extent

from altium_monkey.altium_pcb_embedded_board_authoring import embedded_board_array_extent
def embedded_board_array_extent(spec: 'PcbEmbeddedBoardArraySpec', child_points: 'Sequence[tuple[int, int]]', anchor: 'tuple[int, int]') -> 'tuple[int, int, int, int]'

The X1, Y1, X2, Y2 rectangle Altium caches for an array, internal units.

It is the unrotated array: each copy's child outline points, less the anchor, plus the copy's step, reflected in X when mirrored, about X, Y. Altium's saved extents fit this on records whose child origin is not its outline lower-left.

function

encode_embedded_board_array

from altium_monkey.altium_pcb_embedded_board_authoring import encode_embedded_board_array
def encode_embedded_board_array(spec: 'PcbEmbeddedBoardArraySpec', cached_extent: 'tuple[int, int, int, int]') -> 'bytes'

One record payload as Altium saves it, NUL-terminated. A path with characters outside CP1252 gets the UNICODE marker and sideband the PCB text codec writes.

function

encode_pcb_keepout_restrictions

from altium_monkey import encode_pcb_keepout_restrictions
def encode_pcb_keepout_restrictions(restrictions: 'Iterable[PcbKeepoutRestriction | str]', *, unknown_bits: 'int' = 0) -> 'int'

Return the raw Altium mask for named restrictions plus optional unknown bits.

function

encode_pcbdoc_structural_json

from altium_monkey import encode_pcbdoc_structural_json
def encode_pcbdoc_structural_json(source: 'bytes | Path', *, limits: 'PcbStructuralContractLimits') -> 'bytes'

Encode a PcbDoc as canonical tagged structural JSON.

Encoding reads the whole file as the PcbDoc reader does; ``limits`` applies only to decoding JSON (no Altium evidence for a reader size or count limit, issue 134).

function

encode_pcblib_structural_json

from altium_monkey import encode_pcblib_structural_json
def encode_pcblib_structural_json(source: 'bytes | Path', *, limits: 'PcbStructuralContractLimits') -> 'bytes'

Encode a PcbLib as canonical tagged structural JSON.

Encoding reads the whole file as the PcbLib reader does; ``limits`` applies only to decoding JSON (no Altium evidence for a reader size or count limit, issue 134).

function

format_mil_length

from altium_monkey.altium_pcb_embedded_board_authoring import format_mil_length
def format_mil_length(units: 'int') -> 'str'

A length in internal units as Altium saves it: decimal mils, up to four decimals with trailing zeros dropped, then ``mil`` (``1133.8583mil``, ``1500mil``, ``0mil``).

function

format_rotation_text

from altium_monkey.altium_pcb_embedded_board_authoring import format_rotation_text
def format_rotation_text(degrees: 'float') -> 'str'

A rotation as Altium saves it: a sign place (a space when positive), 15 significant digits and a four-digit exponent (`` 2.70000000000000E+0002``).

function

format_transmit_layers

from altium_monkey.altium_pcb_embedded_board_authoring import format_transmit_layers
def format_transmit_layers(untransmitted_layers: 'Sequence[int]') -> 'str'

The TRANSMITLAYERS layer hash: each listed V7 layer id maps to 0.

function

get_pad_mask_expansion_iu

from altium_monkey.altium_pcb_mask_paste_rules import get_pad_mask_expansion_iu
def get_pad_mask_expansion_iu(pad: 'object') -> 'int'

Return effective pad solder-mask expansion in internal units.

function

get_pad_paste_expansion_iu

from altium_monkey.altium_pcb_mask_paste_rules import get_pad_paste_expansion_iu
def get_pad_paste_expansion_iu(pad: 'object') -> 'int'

Return effective pad paste expansion in internal units.

function

get_via_mask_expansion_iu

from altium_monkey.altium_pcb_mask_paste_rules import get_via_mask_expansion_iu
def get_via_mask_expansion_iu(via: 'object', side: "Literal['top', 'bottom']") -> 'int'

Return effective via solder-mask expansion for top/bottom side.

function

glyph_outline_offset_units

from altium_monkey.altium_text_to_polygon import glyph_outline_offset_units
def glyph_outline_offset_units(font_data: 'bytes', font_name: 'str', glyph_id: 'int') -> 'int | None'

Where a glyph's outline sits relative to the pen, in font design units (Rust ``truetype_text::glyph_outline_offset_units``): the x by which the stored points of glyph ``glyph_id`` of the face of ``font_name`` in ``font_data`` move when it is drawn, its ``hmtx`` left side bearing less its ``glyf`` header xMin.

The TrueType rasterizer puts a glyph's origin at its left phantom point, ``xMin - lsb`` (FreeType ``tt_loader_set_pp``, which the outline loader here applies), so a glyph whose header xMin is not its bearing is drawn that far from its stored points; GDI places a simple glyph so. A composite takes its own header and bearing here, where a component flagged ``USE_MY_METRICS`` gives the rasterizer that component's metrics instead, which this does not follow. Most glyphs store the two equal and give 0, as do a glyph with no outline or an unreadable header and a face without a ``glyf`` table. An older Arial Bold stores its hyphen's points from x 65 with a bearing of 115: it is drawn 50 units right of its stored points, where Altium's Gerber has it. None when the face cannot be read or has no such glyph.

function

has_pad_paste_opening

from altium_monkey.altium_pcb_mask_paste_rules import has_pad_paste_opening
def has_pad_paste_opening(pad: 'object', width_iu: 'int', height_iu: 'int', *, min_opening_iu: 'int' = 400) -> 'bool'

Return whether the effective paste opening remains positive.

function

internal_units_to_nm

from altium_monkey.altium_pcb_layer_context import internal_units_to_nm
def internal_units_to_nm(units: 'int') -> 'int'

A length in Altium internal units as integer nanometres.

One internal unit is 2.54 nm, so the nanometre value rounds, half away from zero; the error is at most 0.5 nm. The layer context gives every Board6 length, such as a physical row's `thickness_nm`, by this rule, and the Rust context uses the same one.

function

interpret_embedded_board

from altium_monkey.altium_pcb_embedded_board import interpret_embedded_board
def interpret_embedded_board(record: 'AltiumPcbEmbeddedBoard', record_index: 'int') -> 'PcbEmbeddedBoardSource'

Read one record's typed fields; never raises.

function

interpret_embedded_boards

from altium_monkey.altium_pcb_embedded_board import interpret_embedded_boards
def interpret_embedded_boards(records: 'Sequence[AltiumPcbEmbeddedBoard]') -> 'tuple[PcbEmbeddedBoardSource, ...]'

Read every record's typed fields, indexed by physical record order.

function

is_pad_solder_mask_only

from altium_monkey.altium_pcb_mask_paste_rules import is_pad_solder_mask_only
def is_pad_solder_mask_only(pad: 'object') -> 'bool'

Return True when a side-specific SMD pad is intentionally mask-only.

This is intentionally narrow. In the real corpus, testpoint flags and manual paste expansions also appear on ordinary copper pads. The only safe pattern we currently treat as mask-only is: - no drilled hole - top or bottom SMD pad - side-specific testpoint-like flag set - no effective paste opening on that side

enum

MechanicalLayerKind

from altium_monkey import MechanicalLayerKind
enum MechanicalLayerKind

Altium mechanical layer semantic kind values.

Members (49)
KindSignatureSummary
memberUNDEFINED= 0
memberASSEMBLY_TOP= 1
memberASSEMBLY_BOTTOM= 2
memberASSEMBLY_NOTES= 3
memberBOARD= 4
memberCOATING_TOP= 5
memberCOATING_BOTTOM= 6
memberCOMPONENT_CENTER_TOP= 7
memberCOMPONENT_CENTER_BOTTOM= 8
memberCOMPONENT_OUTLINE_TOP= 9
memberCOMPONENT_OUTLINE_BOTTOM= 10
memberCOURTYARD_TOP= 11
memberCOURTYARD_BOTTOM= 12
memberDESIGNATOR_TOP= 13
memberDESIGNATOR_BOTTOM= 14
memberDIMENSIONS= 15
memberDIMENSIONS_TOP= 16
memberDIMENSIONS_BOTTOM= 17
memberFAB_NOTES= 18
memberGLUE_POINTS_TOP= 19
memberGLUE_POINTS_BOTTOM= 20
memberGOLD_PLATING_TOP= 21
memberGOLD_PLATING_BOTTOM= 22
memberVALUE_TOP= 23
memberVALUE_BOTTOM= 24
memberVCUT= 25
memberBODY_3D_TOP= 26
memberBODY_3D_BOTTOM= 27
memberROUTE_TOOL_PATH= 28
memberSHEET= 29
memberBOARD_SHAPE= 30
memberOVERLAY_TOP= 31
memberOVERLAY_BOTTOM= 32
memberSOLDER_TOP= 33
memberSOLDER_BOTTOM= 34
memberPASTE_TOP= 35
memberPASTE_BOTTOM= 36
memberTENTING_TOP= 37
memberTENTING_BOTTOM= 38
memberCOVERING_TOP= 39
memberCOVERING_BOTTOM= 40
memberPLUGGING_TOP= 41
memberPLUGGING_BOTTOM= 42
memberFILLING= 43
memberCAPPING= 44
memberDIE_PADS_TOP= 45
memberDIE_PADS_BOTTOM= 46
memberWIREBONDING_TOP= 47
memberWIREBONDING_BOTTOM= 48
function

nm_to_internal_units

from altium_monkey.altium_pcb_layer_context import nm_to_internal_units
def nm_to_internal_units(nm: 'int') -> 'int'

The Altium internal units an integer nanometre length came from.

The nearest unit to ``nm / 2.54``. For a value the context took from Board6 it is exact: `internal_units_to_nm` is off by at most 0.5 nm, which is at most 0.197 units, so this recovers the saved unit count, and units to mils (10,000 per mil) reproduce the saved Board6 value exactly.

function

normalize_project_parameters

from altium_monkey.altium_pcb_special_strings import normalize_project_parameters
def normalize_project_parameters(project_parameters: 'Mapping[str, object] | None') -> 'dict[str, str]'

Normalize project parameters into a case-insensitive map.

Keys are lower-cased; values are stringified.

enum

PadHoleShape

from altium_monkey import PadHoleShape
enum PadHoleShape

PCB pad drill-hole geometry.

Native PAD records encode these values as 0=round, 1=square, and 2=slot. Slots also require a positive slot length.

Members (3)
KindSignatureSummary
memberROUND= 0
memberSQUARE= 1
memberSLOT= 2
enum

PadShape

from altium_monkey import PadShape
enum PadShape

PCB pad geometry kind used by `AltiumPcbDoc.add_pad(...)` and `AltiumPcbFootprint.add_pad(...)`.

Members (5)
KindSignatureSummary
memberCIRCLE= 1
memberRECTANGLE= 2
memberOCTAGONAL= 3
memberROUNDED_RECTANGLE= 4
memberCUSTOM= 10
constant

PCB_KEEPOUT_RESTRICTION_ALL_MASK

from altium_monkey import PCB_KEEPOUT_RESTRICTION_ALL_MASK
PCB_KEEPOUT_RESTRICTION_ALL_MASK: int
constant

PCB_KEEPOUT_RESTRICTION_KNOWN_MASK

from altium_monkey import PCB_KEEPOUT_RESTRICTION_KNOWN_MASK
PCB_KEEPOUT_RESTRICTION_KNOWN_MASK: int
function

pcb_keepout_restriction_names

from altium_monkey import pcb_keepout_restriction_names
def pcb_keepout_restriction_names(mask: 'int') -> 'tuple[str, ...]'

Return stable public names for known keepout restriction bits.

function

pcb_keepout_restriction_unknown_bits

from altium_monkey import pcb_keepout_restriction_unknown_bits
def pcb_keepout_restriction_unknown_bits(mask: 'int') -> 'int'

Return restriction bits outside the confirmed Altium five-bit field.

function

pcb_stand_in_class

from altium_monkey.altium_text_to_polygon import pcb_stand_in_class
def pcb_stand_in_class(family: 'str') -> 'str'

The bundled stand-in of a face the standard list does not name, by its family's name (Rust ``pcb_stand_in_class``): Cousine for a monospaced name, Arimo for a sans name, Tinos for a serif one, else Arimo. A monospaced name has a whole word Mono, Monospace(d), Courier or Consolas, or Code after the family's first word (Cascadia Code, Fira Code; not "Code 128", a barcode font, nor "Arial Unicode MS"). "Sans" is tested before "serif", so "Microsoft Sans Serif" is sans (the schematic renderer's ``_font_category`` tests serif first).

enum

PcbBarcodeKind

from altium_monkey import PcbBarcodeKind
enum PcbBarcodeKind

PCB text barcode symbology for `PcbTextKind.BARCODE`, as Altium saves it (the Texts6 record notes, "2D Barcodes: QR Code And Data Matrix").

Text records keep an unrecognized saved kind as its raw integer.

Members (4)
KindSignatureSummary
memberCODE_39= 0
memberCODE_128= 1
memberQR_CODE= 2
memberDATA_MATRIX= 3
enum

PcbBarcodeRenderMode

from altium_monkey import PcbBarcodeRenderMode
enum PcbBarcodeRenderMode

PCB barcode sizing mode.

`BY_MIN_WIDTH` uses the minimum bar width, while `BY_FULL_WIDTH` fits the generated barcode inside the requested full width.

Members (2)
KindSignatureSummary
memberBY_MIN_WIDTH= 0
memberBY_FULL_WIDTH= 1
enum

PcbBodyProjection

from altium_monkey import PcbBodyProjection
enum PcbBodyProjection

3D component-body side/projection mode.

Used by extruded bodies and embedded STEP bodies to indicate whether the native component-body projection belongs to the top side, bottom side, both sides, or neither side.

Members (4)
KindSignatureSummary
memberTOP= 0
memberBOTTOM= 1
memberBOTH= 2
memberNONE= 3
enum

PcbDielectricType

from altium_monkey.altium_pcb_layer_context import PcbDielectricType
enum PcbDielectricType

Altium's dielectric type, the native Board6 `DIELTYPE`.

Members (5)
KindSignatureSummary
memberNO_DIELECTRIC= 0
memberCORE= 1
memberPREPREG= 2
memberSURFACE_MATERIAL= 3
memberFILM= 4
constant

PCBDOC_STRUCTURAL_SCHEMA

from altium_monkey import PCBDOC_STRUCTURAL_SCHEMA
PCBDOC_STRUCTURAL_SCHEMA: str
enum

PcbDrillPairKind

from altium_monkey.altium_pcb_layer_context import PcbDrillPairKind
enum PcbDrillPairKind

Altium's drill layer pair type (the Layer Identity notes, "Via Spans").

Members (4)
KindSignatureSummary
memberREGULAR= 0
memberMICRO_VIA= 1
memberBACKDRILL= 2
memberCOUNTER_HOLE= 3
enum

PcbEmbeddedBoardDiagnosticCode

from altium_monkey.altium_pcb_embedded_board import PcbEmbeddedBoardDiagnosticCode
enum PcbEmbeddedBoardDiagnosticCode

Why a typed field of an embedded-board record has no value.

Members (5)
KindSignatureSummary
memberFIELD_ABSENT= 'embedded_board_field_absent'
memberFIELD_UNREADABLE= 'embedded_board_field_unreadable'
memberORIGIN_MODE_UNCONFIRMED= 'embedded_board_origin_mode_unconfirmed'
memberRECORDS_IGNORED= 'embedded_board_records_ignored'
memberRECORDS_BEYOND_DATA= 'embedded_board_records_beyond_data'
enum

PcbEmbeddedBoardDiagnosticSeverity

from altium_monkey.altium_pcb_embedded_board import PcbEmbeddedBoardDiagnosticSeverity
enum PcbEmbeddedBoardDiagnosticSeverity

How much a diagnostic costs the record's placement.

Members (2)
KindSignatureSummary
memberERROR= 'error'
memberWARNING= 'warning'
enum

PcbEmbeddedBoardKind

from altium_monkey.altium_pcb_embedded_board import PcbEmbeddedBoardKind
enum PcbEmbeddedBoardKind

What an EmbeddedBoards6 record is (Altium's viewport test).

An array places copies of a child board; Altium's fabrication outputs skip viewports (Altium's Gerber settings list of embedded boards, the IPC-2581 exporter's `GeneratorModule`).

Members (2)
KindSignatureSummary
memberARRAY= 'array'
memberVIEWPORT= 'viewport'
enum

PcbEmbeddedBoardOriginMode

from altium_monkey.altium_pcb_embedded_board import PcbEmbeddedBoardOriginMode
enum PcbEmbeddedBoardOriginMode

Altium's embedded-board origin mode: which child point lands on X, Y.

Altium's IPC-2581 export places the child board origin on X, Y for mode 0 and the lower-left of the child outline's bounding rectangle for any other value (the EmbeddedBoards6 record notes, "Origin mode").

Members (2)
KindSignatureSummary
memberBOARD_ORIGIN= 0
memberBOTTOM_LEFT= 1
enum

PcbIpc4761ViaType

from altium_monkey import PcbIpc4761ViaType
enum PcbIpc4761ViaType

Altium IPC-4761 via-protection type.

Members (13)
KindSignatureSummary
memberNONE= 0
memberTYPE_1A_TENTING= 1
memberTYPE_1B_TENTING= 2
memberTYPE_2A_TENTING_AND_COVERING= 3
memberTYPE_2B_TENTING_AND_COVERING= 4
memberTYPE_3A_PLUGGING= 5
memberTYPE_3B_PLUGGING= 6
memberTYPE_4A_PLUGGING_AND_COVERING= 7
memberTYPE_4B_PLUGGING_AND_COVERING= 8
memberTYPE_5_FILLING= 9
memberTYPE_6A_FILLING_AND_COVERING= 10
memberTYPE_6B_FILLING_AND_COVERING= 11
memberTYPE_7_FILLING_AND_CAPPING= 12
enum

PcbKeepoutRestriction

from altium_monkey import PcbKeepoutRestriction
enum PcbKeepoutRestriction

Named bits in Altium's object-specific keepout restriction mask.

Members (5)
KindSignatureSummary
memberVIA= 1
memberTRACK= 2
memberCOPPER= 4
memberSMD_PAD= 8
memberTH_PAD= 16
enum

PcbLayer

from altium_monkey import PcbLayer
enum PcbLayer

Legacy/TV6 PCB layer IDs used by PcbDoc and PcbLib primitive APIs.

Enum values map to Altium's compact legacy layer enum. That enum contains Top, Mid1 through Mid30, Bottom, and Mechanical 1 through Mechanical 16 only; values 73, 74, and 75 are Drill Drawing, Multi-Layer, and Connect. Extended mechanical layers such as Mechanical 17 and AD 26.8.1 extended signal layers such as Mid31 use separate serialized V7 saved-layer identities and must not be represented by adding linear `PcbLayer` enum values.

Current public authoring methods accept these enum values for legacy `layer` arguments. Some record families also carry V7 side fields, but this enum is intentionally not the V7 layer-reference model.

Members (75)
KindSignatureSummary
memberTOP= 1
memberMID1= 2
memberMID2= 3
memberMID3= 4
memberMID4= 5
memberMID5= 6
memberMID6= 7
memberMID7= 8
memberMID8= 9
memberMID9= 10
memberMID10= 11
memberMID11= 12
memberMID12= 13
memberMID13= 14
memberMID14= 15
memberMID15= 16
memberMID16= 17
memberMID17= 18
memberMID18= 19
memberMID19= 20
memberMID20= 21
memberMID21= 22
memberMID22= 23
memberMID23= 24
memberMID24= 25
memberMID25= 26
memberMID26= 27
memberMID27= 28
memberMID28= 29
memberMID29= 30
memberMID30= 31
memberBOTTOM= 32
memberTOP_OVERLAY= 33
memberBOTTOM_OVERLAY= 34
memberTOP_PASTE= 35
memberBOTTOM_PASTE= 36
memberTOP_SOLDER= 37
memberBOTTOM_SOLDER= 38
memberINTERNAL_PLANE_1= 39
memberINTERNAL_PLANE_2= 40
memberINTERNAL_PLANE_3= 41
memberINTERNAL_PLANE_4= 42
memberINTERNAL_PLANE_5= 43
memberINTERNAL_PLANE_6= 44
memberINTERNAL_PLANE_7= 45
memberINTERNAL_PLANE_8= 46
memberINTERNAL_PLANE_9= 47
memberINTERNAL_PLANE_10= 48
memberINTERNAL_PLANE_11= 49
memberINTERNAL_PLANE_12= 50
memberINTERNAL_PLANE_13= 51
memberINTERNAL_PLANE_14= 52
memberINTERNAL_PLANE_15= 53
memberINTERNAL_PLANE_16= 54
memberDRILL_GUIDE= 55
memberKEEPOUT= 56
memberMECHANICAL_1= 57
memberMECHANICAL_2= 58
memberMECHANICAL_3= 59
memberMECHANICAL_4= 60
memberMECHANICAL_5= 61
memberMECHANICAL_6= 62
memberMECHANICAL_7= 63
memberMECHANICAL_8= 64
memberMECHANICAL_9= 65
memberMECHANICAL_10= 66
memberMECHANICAL_11= 67
memberMECHANICAL_12= 68
memberMECHANICAL_13= 69
memberMECHANICAL_14= 70
memberMECHANICAL_15= 71
memberMECHANICAL_16= 72
memberDRILL_DRAWING= 73
memberMULTI_LAYER= 74
memberCONNECT= 75
enum

PcbLayerFace

from altium_monkey.altium_pcb_layer_context import PcbLayerFace
enum PcbLayerFace

Where a layer sits in a substack.

Members (3)
KindSignatureSummary
memberTOP= 'top'
memberBOTTOM= 'bottom'
memberINNER= 'inner'
enum

PcbLayerFamily

from altium_monkey import PcbLayerFamily
enum PcbLayerFamily

Broad PCB layer family for V7-aware layer references.

Members (9)
KindSignatureSummary
memberNO_LAYER= 'no_layer'
memberSIGNAL= 'signal'
memberINTERNAL_PLANE= 'internal_plane'
memberMECHANICAL= 'mechanical'
memberMISC= 'misc'
memberDIELECTRIC= 'dielectric'
memberDOCUMENT= 'document'
memberFAMILY= 'family'
memberUNKNOWN= 'unknown'
enum

PcbLayerKind

from altium_monkey.altium_pcb_layer_context import PcbLayerKind
enum PcbLayerKind

What a layer is.

Members (13)
KindSignatureSummary
memberCOPPER= 'copper'
memberPLANE= 'plane'
memberSOLDER_MASK= 'solder_mask'
memberSOLDER_PASTE= 'solder_paste'
memberOVERLAY= 'overlay'
memberMECHANICAL= 'mechanical'
memberDRILL_DRAWING= 'drill_drawing'
memberDRILL_GUIDE= 'drill_guide'
memberKEEP_OUT= 'keep_out'
memberMULTI_LAYER= 'multi_layer'
memberCOVERLAY= 'coverlay'
memberDIELECTRIC= 'dielectric'
memberOTHER= 'other'
constant

PcbLayerLike

from altium_monkey.altium_pcb_layer_ref import PcbLayerLike
PcbLayerLike: Union
enum

PcbLayerLookupStatus

from altium_monkey.altium_pcb_layer_context import PcbLayerLookupStatus
enum PcbLayerLookupStatus

How a context lookup ended.

Members (3)
KindSignatureSummary
memberFOUND= 'found'
memberNOT_FOUND= 'not_found'
memberAMBIGUOUS= 'ambiguous'
constant

PCBLIB_STRUCTURAL_SCHEMA

from altium_monkey import PCBLIB_STRUCTURAL_SCHEMA
PCBLIB_STRUCTURAL_SCHEMA: str
enum

PcbLibIdentifierKind

from altium_monkey import PcbLibIdentifierKind
enum PcbLibIdentifierKind

Altium component-library identifier kind.

Mirrors the identifier-kind values used by `SOURCECOMPLIBIDENTIFIERKIND` records.

Members (5)
KindSignatureSummary
memberANY= 0
memberNAME_NO_TYPE= 1
memberNAME_WITH_TYPE= 2
memberFULL_PATH= 3
memberVAULT_NAME= 4
enum

PcbMaskExpansionMode

from altium_monkey import PcbMaskExpansionMode
enum PcbMaskExpansionMode

Altium pad mask-expansion mode.

Native PAD records encode these values as 0=None, 1=Rule, and 2=Manual.

Members (3)
KindSignatureSummary
memberNONE= 0
memberRULE= 1
memberMANUAL= 2
enum

PcbNetClassKind

from altium_monkey import PcbNetClassKind
enum PcbNetClassKind

PCB net-class family kind.

Members (7)
KindSignatureSummary
memberNET= 0
memberCOMPONENT= 1
memberFROM_TO= 2
memberPAD= 3
memberLAYER= 4
memberDIFF_PAIR= 6
memberPOLYGON= 7
enum

PcbPhysicalRowFamily

from altium_monkey.altium_pcb_layer_context import PcbPhysicalRowFamily
enum PcbPhysicalRowFamily

What a physical stack row is made of.

Members (14)
KindSignatureSummary
memberCOPPER= 'copper'
memberPLANE= 'plane'
memberDIELECTRIC= 'dielectric'
memberADHESIVE= 'adhesive'
memberSTIFFENER= 'stiffener'
memberCOVERLAY= 'coverlay'
memberSOLDER_MASK= 'solder_mask'
memberSOLDER_PASTE= 'solder_paste'
memberOVERLAY= 'overlay'
memberSURFACE_FINISH= 'surface_finish'
memberPLATING= 'plating'
memberMARKING= 'marking'
memberMISC= 'misc'
memberOTHER= 'other'
enum

PcbRecordType

from altium_monkey import PcbRecordType
enum PcbRecordType

Record type IDs for Altium PcbLib/PcbDoc binary primitives.

These record types are used in binary streams (Pads6/Data, Tracks6/Data, etc.) in both PcbLib (footprint libraries) and PcbDoc (PCB layout) files.

Members (9)
KindSignatureSummary
memberARC= 1
memberPAD= 2
memberVIA= 3
memberTRACK= 4
memberTEXT= 5
memberFILL= 6
memberREGION= 11
memberCOMPONENT_BODY= 12
memberMODEL= 156
enum

PcbRegionKind

from altium_monkey import PcbRegionKind
enum PcbRegionKind

PCB region semantic kind used when authoring or interpreting region records.

These values are public semantic identifiers, not a 1:1 copy of every native Altium region-kind enum value. Use `pcb_region_kind_to_native_kind(...)` when writing the native `KIND` field.

Members (7)
KindSignatureSummary
memberCOPPER= 0
memberBOARD_CUTOUT= 1
memberPOLYGON_CUTOUT= 2
memberDASHED_OUTLINE= 3
memberUNKNOWN_3= 4
memberCAVITY_DEFINITION= 5
memberUNKNOWN= 99
enum

PcbSignalLayerKind

from altium_monkey import PcbSignalLayerKind
enum PcbSignalLayerKind

Signal-layer role independent of encoded native integers.

Members (3)
KindSignatureSummary
memberTOP= 'top'
memberMID= 'mid'
memberBOTTOM= 'bottom'
enum

PcbSmartUnionKind

from altium_monkey.altium_pcbdoc_unions import PcbSmartUnionKind
enum PcbSmartUnionKind

Altium's SmartUnion object type, the record's UNIONTYPE.

Members (11)
KindSignatureSummary
memberUNKNOWN= 0
memberDRILL_TABLE= 1
memberVIA_STITCHING= 2
memberLAYER_STACK_TABLE= 3
memberACCORDION= 4
memberMETADATA= 5
memberVIA_SHIELDING= 6
memberMULTILINE_TEXT= 7
memberACCORDION_DIFFERENTIAL_PAIR= 8
memberRECTANGLE= 9
memberREUSE_BLOCK= 10
enum

PcbSubstackKind

from altium_monkey.altium_pcb_layer_context import PcbSubstackKind
enum PcbSubstackKind

The construction of a substack.

Members (3)
KindSignatureSummary
memberRIGID= 'rigid'
memberFLEX= 'flex'
memberOTHER= 'other'
enum

PcbTextAutoposition

from altium_monkey import PcbTextAutoposition
enum PcbTextAutoposition

PCB component designator/comment auto-position values.

Mirrors the auto-position values used by component `NAMEAUTOPOSITION` and `COMMENTAUTOPOSITION` fields.

Members (10)
KindSignatureSummary
memberMANUAL= 0
memberTOP_LEFT= 1
memberCENTER_LEFT= 2
memberBOTTOM_LEFT= 3
memberTOP_CENTER= 4
memberCENTER_CENTER= 5
memberBOTTOM_CENTER= 6
memberTOP_RIGHT= 7
memberCENTER_RIGHT= 8
memberBOTTOM_RIGHT= 9
enum

PcbTextJustification

from altium_monkey import PcbTextJustification
enum PcbTextJustification

PCB text anchor and frame justification values.

Used by text frames, inverted text, and other PCB text features that need a deterministic anchor point inside a rectangle.

Members (10)
KindSignatureSummary
memberMANUAL= 0
memberLEFT_TOP= 1
memberLEFT_CENTER= 2
memberLEFT_BOTTOM= 3
memberCENTER_TOP= 4
memberCENTER_CENTER= 5
memberCENTER_BOTTOM= 6
memberRIGHT_TOP= 7
memberRIGHT_CENTER= 8
memberRIGHT_BOTTOM= 9
enum

PcbTextKind

from altium_monkey import PcbTextKind
enum PcbTextKind

PCB text primitive rendering mode.

`STROKE` and `TRUETYPE` create normal text primitives. `BARCODE` creates barcode text and is paired with `PcbBarcodeKind` and `PcbBarcodeRenderMode`.

Members (3)
KindSignatureSummary
memberSTROKE= 'stroke'
memberTRUETYPE= 'truetype'
memberBARCODE= 'barcode'
enum

PcbUnlinkedCustomPadBodyReason

from altium_monkey import PcbUnlinkedCustomPadBodyReason
enum PcbUnlinkedCustomPadBodyReason

Why a saved PADINDEX links its record to no pad.

Members (2)
KindSignatureSummary
memberNAMES_NO_PAD= 'names_no_pad'
memberUNREADABLE= 'unreadable'
enum

PcbViaMode

from altium_monkey import PcbViaMode
enum PcbViaMode

Via stack-mode encoding.

Members (4)
KindSignatureSummary
memberSIMPLE= 0
memberLOCAL_STACK= 1
memberEXTERNAL_STACK= 2
memberRESERVED_3= 3
enum

PcbViaStructureFeatureSide

from altium_monkey import PcbViaStructureFeatureSide
enum PcbViaStructureFeatureSide

Altium IPC-4761 via-structure feature side.

Members (3)
KindSignatureSummary
memberTOP= 0
memberBOTTOM= 1
memberBOTH= 2
enum

PcbViaStructureFeatureType

from altium_monkey import PcbViaStructureFeatureType
enum PcbViaStructureFeatureType

Altium IPC-4761 via-structure feature type.

Members (5)
KindSignatureSummary
memberTENTING= 0
memberCOVERING= 1
memberPLUGGING= 2
memberFILLING= 3
memberCAPPING= 4
function

render_pcb_text

from altium_monkey.altium_text_to_polygon import render_pcb_text
def render_pcb_text(text_record: 'PcbTextRenderRecord', truetype_renderer: 'TrueTypeTextRenderer | None' = None, stroke_renderer: 'StrokeTextRenderer | None' = None, barcode_renderer: 'BarcodeRenderer | None' = None, font_resolver: 'FontPathResolver | None' = None, text_override: 'str | None' = None, stroke_advance_adjustments: 'dict[int, float] | None' = None, stroke_cursor_advances: 'list[float] | None' = None, stroke_target_ink_width_mm: 'float | None' = None, truetype_x_scale: 'float | None' = None, truetype_flatten_tolerance: 'float | None' = None, truetype_gdi_placement: 'GdiFontPlacement | None' = None, font_policy: 'FontPolicy | None' = None, installed_fonts: 'InstalledFonts | None' = None) -> 'TextPolygonResult | StrokeTextResult | None'

Render an AltiumPcbText record to polygons or line segments.

Args: text_record: AltiumPcbText instance from the parser truetype_renderer: Shared renderer instance (created if None) stroke_renderer: Shared renderer instance (created if None) barcode_renderer: Shared renderer instance (created if None) text_override: Optional resolved text value used instead of `text_record.text_content` stroke_advance_adjustments: Optional per-render stroke cursor-advance overrides keyed by character code. stroke_cursor_advances: Optional per-character cursor advances in normalized text-height units for single-line stroke text. stroke_target_ink_width_mm: Optional target visible ink span for stroke text, used for native-oracle cursor calibration. truetype_gdi_placement: The GDI cell and whole-pixel advance placement (``TrueTypeTextRenderer.gdi_font_placement``); a TrueType Text without one takes the placement of its own font, height and style, as Altium lays every TrueType Text out through GDI. font_policy: The policy a TrueType Text's or a caption's font is chosen by when this call makes the renderer (``"altium"`` when None, or ``"embedded_first"``). A given TrueType or barcode renderer has its own, so giving one with a policy is an error. installed_fonts: The installed fonts a TrueType Text's or a caption's font is judged by when this call makes the renderer (this machine's when None); a given renderer keeps its own.

Returns: TextPolygonResult for TrueType/barcode, StrokeTextResult for stroke, or None if rendering fails.

Raises: ValueError: for an unknown ``font_policy``, or a ``font_policy`` given with a TrueType or barcode renderer.

function

resolve_outline_arc_segment

from altium_monkey import resolve_outline_arc_segment
def resolve_outline_arc_segment(start_vertex: 'BoardOutlineVertex', end_vertex: 'BoardOutlineVertex', tol_mils: 'float' = 0.5) -> 'tuple[bool, float]'

Resolve board-outline arc direction and sweep for start->end segment.

Returns: (clockwise, sweep_deg) where sweep_deg is in [0, 360).

function

resolve_pcb_primitive_layer_state

from altium_monkey import resolve_pcb_primitive_layer_state
def resolve_pcb_primitive_layer_state(primitive: 'object', *, registry: 'PcbLayerRegistry | None' = None, legacy_layer_field: 'str' = 'layer', v7_saved_layer_id_field: 'str | None' = 'v7_layer_id', runtime_v7_layer_id_field: 'str | None' = None, v7_layer_token_field: 'str | None' = None) -> 'PcbPrimitiveLayerState'

Resolve a primitive layer from V7 side fields before legacy storage.

function

resolve_pcb_text_content

from altium_monkey.altium_pcb_text_geometry import resolve_pcb_text_content
def resolve_pcb_text_content(pcbdoc: 'AltiumPcbDoc', text: 'AltiumPcbText', *, project_parameters: 'dict[str, str] | None' = None) -> 'str'

Resolve fresh Source text against exact project/component parameters.

Component comment precedence is Comment, Value, authored comment, then the established imported description policy. Source records stay unchanged.

function

resolved_layer_stack_from_board

from altium_monkey.altium_resolved_layer_stack import resolved_layer_stack_from_board
def resolved_layer_stack_from_board(board: 'object', *, primitive_layer_ids: 'set[int] | None' = None, drill_pairs: 'set[tuple[int, int]] | None' = None, board_regions: 'list[object] | tuple[object, ...] | None' = None) -> 'ResolvedLayerStack'

Build a fully resolved layer stack from board data plus optional evidence.

Deprecated: use the document's layer context, `AltiumPcbDoc.layers()`.

function

resolved_layer_stack_from_pcbdoc

from altium_monkey.altium_resolved_layer_stack import resolved_layer_stack_from_pcbdoc
def resolved_layer_stack_from_pcbdoc(pcbdoc: 'object') -> 'ResolvedLayerStack'

Build a fully resolved layer stack from parsed Altium PcbDoc data.

Deprecated: use the document's layer context, `AltiumPcbDoc.layers()`. For an `AltiumPcbDoc` this returns the resolved stack its context was built from, so the stack is built once per document.

function

should_force_pad_copper_render

from altium_monkey.altium_pcb_mask_paste_rules import should_force_pad_copper_render
def should_force_pad_copper_render(pad: 'object', layer: 'PcbLayer | int') -> 'bool'

Return True for legacy testpoint pads that still need board-copper output.

Some older TC2030-style pads carry a side-specific testpoint flag and a large negative paste expansion to suppress the paste aperture. Fabrication exports can treat that pattern as a mask-only aperture, but visual board copper outputs still need to draw the owning-side copper pad.

enum

StackupXFeatureId

from altium_monkey import StackupXFeatureId
enum StackupXFeatureId

Known Altium Layer Stack Manager feature GUIDs for ``StackupXFeature.id``.

Members (5)
KindSignatureSummary
memberSTANDARD_STACKUP= 'c8939e8a-fd0e-4d52-8860-b7a98f452016'
memberIMPEDANCE_CALCULATOR= 'e3df2b86-5f1b-49ca-b266-d1ae57f0ba6f'
memberRIGID_FLEX= '5277e6a4-9e5f-4f54-951f-dc18cfeb7530'
memberRIGID_FLEX_ADVANCED= '4e697926-85c3-4c60-8b9b-e23ccb226764'
memberBACK_DRILLS= '0a82ba33-e4d8-43f3-9c01-412dc26bdd5e'
enum

StackupXLayerType

from altium_monkey import StackupXLayerType
enum StackupXLayerType

Well-known Altium Layer Stack Manager layer ``TypeId`` GUIDs.

Use these as ``StackupXLayer.type_id`` values when authoring stacks so callers never need to know the raw GUIDs. They are the Layer Stack Manager's layer schema GUIDs.

Members (27)
KindSignatureSummary
memberABSTRACT= '5ee2359d-ad77-4dad-bd77-5a2334695235'
memberUNKNOWN= '4af561f4-6919-43d8-942a-d3579b371c26'
memberPHYSICAL= 'daa9eccc-0064-462d-854e-0b9e829ef563'
memberBASE_DIELECTRIC= '56eb1ca5-014a-4387-a43e-1485f44f081e'
memberOVERLAY= 'c7ef040e-8d00-490b-b00c-a7e7823ff174'
memberBIKINI_COVERLAY= '8de65238-89ed-47c5-bbf8-0f6f02d1899c'
memberPASTE_MASK= 'e6a36257-b90f-45e5-9f8d-a213ecdb687c'
memberMECHANICAL= '7a47e6b3-b591-41f7-a27b-8c6b0477e458'
memberSOLDER_MASK= '7b384237-13d8-4318-8bcb-accd8d9a51e7'
memberCOPPER_FOIL= '31e48829-e750-4c28-95e0-1a8313f0158e'
memberCOPPER_SIGNAL= 'f4eccd87-2cfb-4f37-be50-4f3a272b4d01'
memberINTERNAL_PLANE= 'f59fab94-c5ed-467d-94cd-f60a323c5d5b'
memberSURFACE_FINISH= 'b0827674-798c-4cf8-807c-8e6c2a11c145'
memberDIELECTRIC= '92b02d5e-8d69-48a8-880e-ac4b77db099d'
memberPREPREG= '1a79611a-039d-4d40-a204-53c26c50f8b5'
memberCORE= '136c62ef-1fa6-4897-ae71-7e797b632b92'
memberPLATING= '90b89aa0-a48a-45f4-82f5-b3eca4ec8cce'
memberADHESIVE= '448f9952-79ba-41d8-a8f4-4713ee7a3828'
memberSTIFFENER= '9fd889fa-c97a-401c-a066-e5f746678381'
memberMISC= '786b5f28-f093-4084-bba7-46e8f4f24f55'
memberMARKING= '886956f5-b2e9-4114-93f3-f69af872bffb'
memberPRINTED_ELECTRONICS_LAYER= '8053a284-8886-43e8-baa0-5aa1d8de97d1'
memberPRINTED_ELECTRONICS_CONDUCTIVE= 'c558fe3f-d914-4761-9d82-a12591ceb133'
memberPRINTED_ELECTRONICS_NONCONDUCTIVE= '18be3c27-bfeb-4bba-8e9a-df4caeee1731'
memberPRINTED_ELECTRONICS_ISOLATION= '8590cc63-42d8-48cb-8307-72991910bcc9'
memberPRINTED_ELECTRONICS_CORE= 'e9a93ad8-17ee-438c-a1b6-92a3995dfda8'
memberPRINTED_ELECTRONICS_PREPREG= '743de2f9-2902-4e35-b39c-bacd385f87dd'
function

substitute_pcb_special_strings

from altium_monkey.altium_pcb_special_strings import substitute_pcb_special_strings
def substitute_pcb_special_strings(text: 'str', params_ci: 'dict[str, str]', *, multiline: 'bool' = False) -> 'str'

Substitute PCB special strings from a case-insensitive parameter map, as Altium converts a Text's content (the Texts6 record notes, "Special Strings").

Behavior: - Dot tokens resolve from `params_ci` (for example `.PCB_MIXDOWN`) - `.VariantName` defaults to `[No Variations]` when not provided - `.VersionControl_RevNumber` and `.VersionControl_RevNumberShort` default to `Not in version control`, as Altium writes them for a document not under version control - A single-line text (`multiline=False`) that starts with `.` is one special string: everything after the dot is its name, and a name with no value is drawn as written, so `.Hole_Count holes` draws as written; a lone `.` draws nothing - In any other text, and in every text frame (`multiline=True`), each name is replaced in place (`convert_special_string_names`): `Holes: .Hole_Count` draws as `Holes: 14`, `'.Hole_Count'.'.Pad_Count'` as `14.15`, `x.Hole_Count` as `x14` and `".Hole_Count"` as `"14"` - `+` is text, not an operator: `'Holes ' + .Hole_Count` draws as `'Holes ' + 14`, and a text frame of `.Pad_Count + '/' + .Hole_Count` as `15 + '/' + 14` (Altium 26.10.1.6's Gerber) - Unresolved names are drawn as written

function

validate_pcbdoc_structural_json

from altium_monkey import validate_pcbdoc_structural_json
def validate_pcbdoc_structural_json(source: '_JSON_SOURCE', *, limits: 'PcbStructuralContractLimits') -> 'None'

Validate tagged or legacy PcbDoc structural JSON.

function

validate_pcblib_structural_json

from altium_monkey import validate_pcblib_structural_json
def validate_pcblib_structural_json(source: '_JSON_SOURCE', *, limits: 'PcbStructuralContractLimits') -> 'None'

Validate tagged or legacy PcbLib structural JSON.

altium-monkey v2026.11.26 · gobblerito·Docs updated 2026.11.29 17:55 UTC (0665053)