On This Page (60) PCB, Footprints & Stackups AltiumPcbDoc, AltiumPcbLib, V7 layer references, builders, and layer stacks.
All kinds Classes Enums Functions Constants 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) Kind Signature Summary classmethod from_property_value(cls, raw_value: 'object') -> "'AltiumBoardBendLine'"property radius_mils -> 'float | None'Bend radius in mils, derived from the native raw coordinate value. method to_debug_json(self) -> 'dict[str, object]'method to_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) Kind Signature Summary property bounding_box -> 'tuple[float, float, float, float]'Returns (min_x, min_y, max_x, max_y) in mils. classmethod from_points_mils(cls, points_mils: 'list[tuple[float, float]] | tuple[tuple[float, float], ...]') -> 'AltiumBoardOutline'Create a straight-segment outline from footprint-plane point tuples. property points_mils -> 'tuple[tuple[float, float], ...]'Return outline vertex coordinates as `(x_mils, y_mils)` tuples. classmethod rectangle_mils(cls, *, left_mils: 'float', bottom_mils: 'float', right_mils: 'float', top_mils: 'float') -> 'AltiumBoardOutline'Create a rectangular outline from explicit mil-unit bounds. property vertex_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method entry_by_model_id(self, model_id: 'str') -> 'AltiumLayerRegistryEntry | None'method to_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) Kind Signature Summary method to_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) Kind Signature Summary method board_region_by_name(self, name: 'str') -> 'AltiumStackRegion | None'Lookup one board stack region by display name. method board_regions_for_layerstack_id(self, layerstack_id: 'str') -> 'tuple[AltiumStackRegion, ...]'Return board regions assigned to a native substack GUID/ref. method branches_for_stack_ref(self, stack_ref: 'str') -> 'tuple[AltiumStackBranch, ...]'Return branch topology records that reference a stack GUID/ref. classmethod canonical_empty(cls) -> "'AltiumLayerStackDocument'"Build the model from the canonical empty PcbDoc builder profile. classmethod four_layer_rigid(cls) -> "'AltiumLayerStackDocument'"Build the existing four-layer rigid FR-4 template through the model. classmethod from_board(cls, board: 'object', *, board_regions: 'tuple[object, ...] | list[object] | None' = None, ordered_stack_entries: 'tuple[str, ...]' = (), source_origin: 'str' = '') -> "'AltiumLayerStackDocument'"classmethod from_board_data(cls, board_data: 'object', *, board_regions: 'tuple[object, ...] | list[object] | None' = None) -> "'AltiumLayerStackDocument'"classmethod from_pcbdoc(cls, pcbdoc: 'object') -> "'AltiumLayerStackDocument'"classmethod from_pcbdoc_builder_profile(cls, profile: 'object') -> "'AltiumLayerStackDocument'"classmethod from_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. classmethod from_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. classmethod from_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. classmethod from_stackup(cls, source: 'object') -> "'AltiumLayerStackDocument'"Build the common layer-stack view from a `.stackup` text export. classmethod from_stackupx(cls, source: 'object') -> "'AltiumLayerStackDocument'"Build the common layer-stack view from a `.stackupx` XML export. method layers_for_board_region(self, board_region_or_layerstack_id: 'object') -> 'tuple[AltiumStackLayer, ...]'Return physical layers enabled for a board region or raw layerstack id. method layers_for_substack(self, source_stackup_ref: 'str') -> 'tuple[AltiumStackLayer, ...]'Return physical layers enabled for a native substack GUID/ref. method native_pcbdoc_write_support(self) -> 'AltiumNativePcbDocWriteSupport'Report whether this stack can be regenerated as native PcbDoc today. method physical_stack_by_ref(self, stack_ref: 'str') -> 'AltiumPhysicalStack | None'Lookup a physical master stack by native stack GUID/ref. property stackup_settings -> 'AltiumStackupSettings'Return typed stackup-level Layer Stack Manager settings. method substack_by_source_ref(self, source_stackup_ref: 'str') -> 'AltiumStackSubstack | None'Lookup a rigid/flex substack by native stackup GUID/ref. method substacks_by_name(self, name: 'str') -> 'tuple[AltiumStackSubstack, ...]'Return all substacks with a matching display name. method to_authored_board_data_entries(self) -> 'tuple[str, ...]'Return ordered stack entries with typed model values overlaid. method to_board_data_entries(self) -> 'tuple[str, ...]'Return ordered Board6/Data stack entries captured from the source. method to_board_data_for_new_pcbdoc(self, *, base_board_data: "'PcbDocBoardData | None'" = None) -> "'PcbDocBoardData'"Build new-document `Board6/Data` with stack sections from this model. method to_board_regions_data_for_new_pcbdoc(self, *, base_board_regions_data: "'PcbDocBoardRegionsData | None'" = None) -> "'PcbDocBoardRegionsData'"Build new-document `BoardRegions/Data` from typed stack regions. method to_canonical_empty_board_data(self) -> "'PcbDocBoardData'"Build canonical empty `Board6/Data` with stack entries from this model. method to_debug_json(self) -> 'dict[str, object]'Return deterministic JSON-compatible debug data for tests and inspection. method to_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. method to_stackup(self) -> "'AltiumStackupDocument'"Build an Altium `.stackup` text interchange document from this model. method to_stackup_text(self) -> 'str'Serialize this model as Altium `.stackup` text. method to_stackupx(self) -> "'AltiumStackupXDocument'"Build an Altium `.stackupx` XML interchange document from this model. method to_stackupx_text(self) -> 'str'Serialize this model as Altium `.stackupx` XML text. classmethod two_layer_rigid(cls) -> "'AltiumLayerStackDocument'"Build the existing two-layer rigid FR-4 template through the model. method unsupported_source_field_buckets(self) -> 'dict[str, tuple[str, ...]]'Return layer-stack source fields preserved but not yet typed-authored. method with_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. method with_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. method with_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) Kind Signature Summary method to_debug_json(self) -> 'dict[str, object]'Return deterministic JSON-compatible diagnostic data. method unsupported_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) Kind Signature Summary property center_x_mils -> 'float'Get center X in mils. property center_y_mils -> 'float'Get center Y in mils. method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this arc. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse ARC record from binary data. property radius_mils -> 'float'Get radius in mils. property record_type -> 'PcbRecordType'Return the PCB arc record discriminator. method serialize_to_binary(self) -> 'bytes'Serialize ARC record to binary format. property signed_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) Kind Signature Summary property channel_offset -> 'int | None'Numeric channel instance offset used by hierarchical/repeated projects. property comment_auto_position -> 'PcbTextAutoposition | None'property comment_on -> 'bool'property enable_part_swapping -> 'bool | None'property enable_pin_swapping -> 'bool | None'property footprint_description -> 'str'method get_layer_normalized(self) -> 'str'Get normalized layer string. method get_rotation_degrees(self) -> 'float'Get rotation in degrees. method get_x_mils(self, board_origin_x: 'float' = 0.0) -> 'float'Get X position in mils (relative to board origin). method get_y_mils(self, board_origin_y: 'float' = 0.0) -> 'float'Get Y position in mils (relative to board origin). property height -> 'str'property jumpers_visible -> 'bool | None'property lock_strings -> 'bool | None'property locked -> 'bool'Whether the component is locked (`LOCKED`); unlocked when omitted. property name_auto_position -> 'PcbTextAutoposition | None'property name_on -> 'bool'property source_component_library -> 'str'property source_component_library_identifier -> 'str'property source_component_library_identifier_kind -> 'PcbLibIdentifierKind | None'property source_designator -> 'str'property source_footprint_library -> 'str'property source_footprint_library_name -> 'str'property source_hierarchical_path -> 'str'property source_hierarchy_segments -> 'tuple[str, ...]'property source_lib_reference -> 'str'property source_unique_id -> 'str'property source_unique_id_segments -> 'tuple[str, ...]'method to_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) Kind Signature Summary property cavity_height_mils -> 'float'Cavity height in mils. method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this component body. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. property overall_height_mils -> 'float'Overall height in mils. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse ComponentBody record from binary data. property record_type -> 'PcbRecordType'Return the PCB component-body record discriminator. method serialize_to_binary(self) -> 'bytes'Serialize ComponentBody record to binary format. property standoff_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) Kind Signature Summary classmethod create(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. classmethod from_record(cls, record: 'dict[str, str]', source: 'bytes | None' = None) -> "'AltiumPcbDifferentialPair'"Parse one `DifferentialPairs6/Data` text record. property net_names -> 'tuple[str, str]'Return `(positive_net_name, negative_net_name)`. method resolve_negative_net(self, pcbdoc: "'AltiumPcbDoc'") -> 'AltiumPcbNet | None'Resolve the negative net name against a parsed `AltiumPcbDoc`. method resolve_positive_net(self, pcbdoc: "'AltiumPcbDoc'") -> 'AltiumPcbNet | None'Resolve the positive net name against a parsed `AltiumPcbDoc`. method to_record(self) -> 'dict[str, str]'Serialize to a `DifferentialPairs6/Data` text-record dictionary. method uses_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) Kind Signature Summary method add_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. method add_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. method add_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. method add_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. method add_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. method add_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 method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_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. method add_user_union_member(self, union_index: 'int', member: 'object') -> 'PcbUserUnion'Add one primitive, member reference, or component to a user union. method add_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. method add_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. method add_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. method asset_inventory(self, *, include_hashes: 'bool' = False) -> 'AltiumAssetInventory'Return extractable asset inventory for this PcbDoc. method board_region_source_presence(self) -> "Literal['absent', 'empty', 'present', 'unresolved']"Read current BoardRegions presence without serializing or reopening. method board_stack_declaration_evidence(self) -> 'PcbBoardStackSourceEvidence'Read original Board6 declaration observations and their current binding. method component_body_companion_index(self, ordinary_index: 'int') -> 'int | None'Return the current analytic collection index for an unchanged Source body. method compute_board_centroid_mils(self) -> 'tuple[float, float] | None'Compute a stable board centroid in mils from board-outline geometry. method compute_board_centroid_relative_to_origin_mils(self) -> 'tuple[float, float] | None'Compute board centroid offset from board datum/origin in mils. method create_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. method custom_pads_without_body(self) -> 'tuple[int, ...]'Return the Pads6 indices of the custom pads that save no body: method delete_user_union(self, union_index: 'int') -> 'None'Delete a user-defined PCB union and clear its parsed member fields. property differential_pair_classes -> 'list[AltiumPcbNetClass]'Return `Classes6/Data` object classes whose members are pair names. property differential_pairs_by_net_name -> 'dict[str, AltiumPcbDifferentialPair]'Map each referenced net name to its differential-pair object. method embedded_asset_inventory(self, *, include_hashes: 'bool' = False) -> 'EmbeddedAssetInventory'Return an aggregate read-only inventory for embedded PCB assets. method embedded_font_payloads(self) -> 'tuple[bytes, ...]'Return decompressed embedded font payloads in summary order. method embedded_font_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbFontSummary, ...]'Return read-only embedded TrueType font inventory summaries. property embedded_fonts_end -> 'EmbeddedFontsEnd | None'Where Altium stops loading the board's embedded fonts method embedded_model_payloads(self) -> 'tuple[bytes, ...]'Return decompressed embedded model payloads in summary order. method embedded_model_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbModelSummary, ...]'Return read-only embedded 3D model inventory summaries. method extract_asset(self, ref: 'AltiumAssetRef') -> 'AltiumExtractedAsset'Extract one asset selected from `asset_inventory()`. method extract_embedded_fonts(self, output_dir: 'Path', verbose: 'bool' = False) -> 'list[Path]'Extract embedded PCB TrueType fonts to `output_dir`. method extract_embedded_models(self, output_dir: 'Path', verbose: 'bool' = False) -> 'list[Path]'Extract embedded 3D model payloads to `output_dir`. method extract_footprint(self, ref_or_name_or_index: 'object', *, verbose: 'bool' = False) -> 'AltiumPcbLib'Extract one PcbDoc footprint as a single-footprint PcbLib. method extract_pcblib(self, output_path: 'Path | None' = None, verbose: 'bool' = False) -> 'AltiumPcbLib'Extract footprints from PcbDoc as an AltiumPcbLib object. method fab(self, **options: 'Unpack[ContextOptions]') -> 'Fab'This board's Fab outputs and views, with its inputs fixed. property file_version_info -> 'FileVersionInfo'The `FileVersionInfo/Data` stream: the format changes the Altium that classmethod from_bytes(cls, data: 'bytes', filename: 'Path | str | None' = 'embedded.PcbDoc', verbose: 'bool' = False, parse_geometry: 'bool' = True) -> 'AltiumPcbDoc'Parse a PcbDoc from OLE bytes. classmethod from_file(cls, filepath: 'Path', verbose: 'bool' = False, parse_geometry: 'bool' = True) -> 'AltiumPcbDoc'Parse a PcbDoc file. method get_component_origin_mils(self, component_index: 'int', *, origin_relative: 'bool' = True) -> 'tuple[float, float]'Return the PcbDoc component placement origin in mils. method get_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. method get_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. method get_component_primitives(self, component_index: 'int') -> 'dict[str, list]'Get all primitives belonging to a component by index. method get_components_by_footprint(self, footprint: 'str') -> 'list[AltiumPcbComponent]'Get all components using a specific footprint. method get_differential_pair(self, name: 'str') -> 'AltiumPcbDifferentialPair | None'Return a differential pair by name, case-insensitively. method get_embedded_font_payload(self, index: 'int') -> 'bytes'Return one decompressed embedded font payload by inventory index. method get_embedded_model_entries(self) -> 'list[tuple[AltiumPcbModel, bytes]]'Return embedded model metadata plus compressed payload bytes. method get_embedded_model_payload(self, index: 'int') -> 'bytes'Return one decompressed embedded model payload by inventory index. method get_mechanical_layer_kind(self, layer: 'int | str | PcbLayer') -> 'MechanicalLayerKind | None'Return the semantic kind assigned to a mechanical layer, if present. method get_net_primitives(self, net_index: 'int') -> 'dict[str, list]'Get all primitives assigned to a net by index. method get_unique_footprints(self) -> 'set[str]'Get unique footprint names used in the design. method layers(self) -> 'PcbLayerContext'Return this board's one layer context. method mark_modified(self) -> 'None'Record that this document's source records changed. method pad_mask_shape(self, pad_index: 'int', layer: 'PcbMaskShapeLayer') -> 'PcbMaskLayerShape | None'The shape the pad at ``pad_index`` in ``pads`` keeps on mask method place_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. method primitive_guid(self, record: 'object') -> 'uuid.UUID | None'The `PrimitiveGuids` GUID this board saves for `record`, a net (type method remove_mechanical_layer_pairs_for(self, layers: 'Collection[int | str | PcbLayer]') -> 'None'Remove all ``MECHPAIR*`` records referencing any layer in ``layers`` and compact indices. method remove_text(self, text: 'AltiumPcbText') -> 'None'Remove one Text record, and its full string from `WideStrings6`. method remove_user_union_member(self, union_index: 'int', member: 'object') -> 'PcbUserUnion'Remove one primitive, member reference, or component from a user union. method rename_user_union(self, union_index: 'int', name: 'str') -> 'PcbUserUnion'Rename an existing user-defined PCB union. method replace_via_pattern_union(self, union: 'PcbViaStitchingUnion | PcbViaShieldingUnion') -> 'None'Replace one via-stitching or via-shielding SmartUnion with `union`. method routing_context_parse_failures(self) -> 'tuple[PcbRoutingContextParseFailure, ...]'Read original tolerated Nets/Classes/DifferentialPairs/Rules failures. method save(self, filepath: 'Path | str', verbose: 'bool' = False) -> 'None'Save to binary PcbDoc format. method section_read_failures(self) -> 'tuple[tuple[str, str], ...]'Sections whose read failed on open, each with the reason. method set_board_outline(self, outline: 'AltiumBoardOutline') -> 'None'Replace the board outline with line/arc outline geometry in mils. method set_layer_stack_document(self, document: 'AltiumLayerStackDocument') -> 'None'Apply a typed layer-stack document to this board. method set_layer_stack_template(self, template: 'object') -> 'None'Apply a named or explicit layer-stack template to this board. method set_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. method set_mechanical_layer_kind(self, layer: 'int | str | PcbLayer', kind: 'int | str | MechanicalLayerKind') -> 'None'Set the semantic kind assigned to a mechanical layer. method set_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. method set_origin_mils(self, x_mils: 'float', y_mils: 'float') -> 'None'Set the board origin in mils. method set_origin_to_outline_lower_left(self) -> 'None'Set the board origin to the lower-left bounds of the current outline. method set_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. method set_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. method set_outline_vertices_mils(self, vertices_mils: 'Sequence[tuple[float, float]]') -> 'None'Replace the board outline with explicit polygon vertices in mils. method to_bom(self, **options: 'Unpack[BoardBomOptions]') -> 'FabOutput'This board's PCB BOM as Altium writes it from the PcbDoc, in memory, method to_gerbers(self, **options: 'Unpack[BoardGerberOptions]') -> 'FabOutput'This board's Gerber files, in memory, in one call. method to_ipc2581(self, **options: 'Unpack[BoardIpc2581Options]') -> 'FabOutput'This board's IPC-2581B document, in memory, in one call. method to_layer_svgs(self, **options: 'Unpack[BoardSvgOptions]') -> 'FabOutput'This board as one SVG image per layer key, in memory, in one call. method to_nc_drill(self, **options: 'Unpack[BoardNcDrillOptions]') -> 'FabOutput'This board's NC drill set, in memory, in one call. method to_pnp(self, **options: 'Unpack[BoardPnpOptions]') -> 'FabOutput'This board's Pick and Place file as Altium writes it, in memory, in method to_svg(self, **options: 'Unpack[BoardSvgOptions]') -> 'FabOutput'This board as one SVG image, in memory, in one call. method translate_region(self, index: 'int', *, dx_mils: 'float', dy_mils: 'float') -> 'None'Translate one retained placed copper Region and its same-GUID companion. method unlinked_custom_pad_bodies(self) -> 'tuple[PcbUnlinkedCustomPadBody, ...]'Return the Region and ShapeBasedRegion records whose saved PADINDEX method unreadable_streams(self) -> 'tuple[tuple[str, str], ...]'Streams whose sector chain could not be followed to its end. property user_unions -> 'tuple[PcbUserUnion, ...]'Return read-only semantic views of named user-defined PCB unions. property via_shielding_unions -> 'tuple[PcbViaShieldingUnion, ...]'Typed via-shielding SmartUnions, in SmartUnions/Data order. property via_stitching_unions -> 'tuple[PcbViaStitchingUnion, ...]'Typed via-stitching SmartUnions, in SmartUnions/Data order. method written_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) Kind Signature Summary classmethod from_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) Kind Signature Summary property center_x -> 'int'Get center X in internal units. property center_y -> 'int'Get center Y in internal units. property height_internal -> 'int'Get height in internal units. method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this fill. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse FILL record from binary data. property pos1_x_mils -> 'float'Get position 1 X in mils. property pos1_y_mils -> 'float'Get position 1 Y in mils. property pos2_x_mils -> 'float'Get position 2 X in mils. property pos2_y_mils -> 'float'Get position 2 Y in mils. property record_type -> 'PcbRecordType'Return the PCB fill record discriminator. method serialize_to_binary(self) -> 'bytes'Serialize FILL record to binary format. property width_internal -> 'int'Get width in internal units.
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) Kind Signature Summary method add_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`. method add_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. method add_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. method add_footprint(self, name: 'str', *, height: 'str' = '0mil', description: 'str' = '', item_guid: 'str' = '', revision_guid: 'str' = '') -> 'AltiumPcbFootprint'Create a footprint owned by this PcbLib. method asset_inventory(self, *, include_hashes: 'bool' = False) -> 'AltiumAssetInventory'Return extractable asset inventory for this PcbLib. classmethod combine(cls, inputs: 'Path | str | Iterable[Path | str]', *, verbose: 'bool' = False) -> 'AltiumPcbLib'Combine one or more PcbLib files into a single builder-authored library. staticmethod combine_provenance_path(filepath: 'Path') -> 'Path'Default JSON sidecar path for a joined/combine provenance manifest. method embedded_asset_inventory(self, *, include_hashes: 'bool' = False) -> 'EmbeddedAssetInventory'Return an aggregate read-only inventory for embedded PCB assets. method embedded_font_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbFontSummary, ...]'Return typed summaries of `embedded_fonts`. property embedded_fonts -> 'list[EmbeddedFont]'The embedded TrueType fonts of `raw_embedded_fonts`. method embedded_model_payloads(self) -> 'tuple[bytes, ...]'Return decompressed embedded model payloads in summary order. method embedded_model_summaries(self, *, include_hashes: 'bool' = False) -> 'tuple[EmbeddedPcbModelSummary, ...]'Return read-only embedded 3D model inventory summaries. method extract_asset(self, ref: 'AltiumAssetRef') -> 'AltiumExtractedAsset'Extract one asset selected from `asset_inventory()`. method extract_embedded_models(self, output_dir: 'Path | str', verbose: 'bool' = False) -> 'list[Path]'Extract embedded 3D model payloads to `output_dir`. method extract_footprint(self, ref_or_name_or_index: 'object') -> 'AltiumPcbLib'Extract one PcbLib footprint as a single-footprint PcbLib. property file_version_info -> 'FileVersionInfo'The `FileVersionInfo/Data` stream: the format changes the Altium that method filename(self) -> 'str'Return the source filename portion for this library. method find_footprint(self, name: 'str') -> 'AltiumPcbFootprint | None'Return the first footprint with `name`, or `None` if absent. method footprint_count(self) -> 'int'Return the number of parsed or authored footprints in this library. method footprint_names(self) -> 'list[str]'Return parsed or authored footprint names in library order. classmethod from_bytes(cls, data: 'bytes', filename: 'Path | str' = 'embedded.PcbLib', debug: 'bool' = False) -> 'AltiumPcbLib'Parse a complete PcbLib from OLE bytes. classmethod from_file(cls, filepath: 'Path', debug: 'bool' = False) -> 'AltiumPcbLib'Parse a complete PcbLib file. method get_embedded_model_entries(self) -> 'list[tuple[AltiumPcbModel, bytes]]'Return embedded model metadata plus compressed payload bytes. method get_embedded_model_payload(self, index: 'int') -> 'bytes'Return one decompressed embedded model payload by inventory index. staticmethod get_footprint_names(filepath: 'Path') -> 'list[str]'Get footprint names without full parse (fast storage scan). method get_mechanical_layer_kind(self, layer: 'int | str | PcbLayer') -> 'MechanicalLayerKind | None'Return the semantic kind assigned to a mechanical layer, if present. method layers(self) -> 'PcbLayerContext'Return this library's one layer context. method remove_mechanical_layer_pairs_for(self, layers: 'Collection[int | str | PcbLayer]') -> 'None'Remove all ``MECHPAIR*`` records referencing any layer in ``layers`` and compact indices. method rename_footprint(self, footprint_or_name: 'AltiumPcbFootprint | str', name: 'str') -> 'AltiumPcbFootprint'Rename one footprint owned by this library. method save(self, filepath: 'Path | str', debug: 'bool' = False) -> 'None'Save to binary PcbLib format. method save_subset(self, filepath: 'Path | str', footprint_names: 'Iterable[str]', debug: 'bool' = False) -> 'None'Save a PcbLib containing only the named footprints. method set_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. method set_mechanical_layer_kind(self, layer: 'int | str | PcbLayer', kind: 'int | str | MechanicalLayerKind') -> 'None'Set the semantic kind assigned to a mechanical layer. method set_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. method split(self, output_dir: 'Path', verbose: 'bool' = False) -> 'dict[str, Path]'Split this multi-footprint PcbLib into individual files. method write_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) Kind Signature Summary method to_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) Kind Signature Summary method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse MODEL record from binary data. property record_type -> 'PcbRecordType'Return the PCB model record discriminator. method serialize_to_binary(self) -> 'bytes'Serialize MODEL record to binary format. method serialize_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) Kind Signature Summary classmethod from_record(cls, record: 'dict[str, Any]', source: 'bytes | None' = None) -> 'AltiumPcbNet'Parse net from Nets6/Data text record. method to_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) Kind Signature Summary classmethod from_record(cls, record: 'dict[str, Any]', source: 'bytes | None' = None) -> 'AltiumPcbNetClass'Parse net class from Classes6/Data text record. method to_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) Kind Signature Summary method corner_radius_mils_on_layer(self, layer: 'PcbLayer') -> 'float'Corner radius in mils on one layer for rounded-rectangle pads. property corner_radius_percent_exact -> 'float | None'Exact fractional corner percent for the top layer, or None. property corner_radius_percentage -> 'int'Get corner radius percentage for top layer (0 if not rounded rect). property effective_top_shape -> 'int'Get effective top layer shape, applying SubRecord 6 alt_shape overrides. method exact_corner_radius_percent_on_layer(self, layer: 'PcbLayer') -> 'float | None'Exact fractional corner percent for one layer, or None. property has_removed_copper_layer_map -> 'bool'Return whether the complete persisted 32-byte map is present. method has_stored_copper_land_on_layer(self, layer: 'PcbLayer') -> 'bool'Return structural stored-land applicability for a copper layer. method hole_center_internal_units(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[int, int]'Get drilled-hole center in internal units. method hole_center_mils(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[float, float]'Get drilled-hole center in mils. property hole_negative_tolerance -> 'int'Lower drill-hole tolerance magnitude in internal units. property hole_negative_tolerance_mils -> 'float | None'Lower drill-hole tolerance magnitude in mils, or ``None`` when unset/N/A. property hole_positive_tolerance -> 'int'Upper drill-hole tolerance in internal units. property hole_positive_tolerance_mils -> 'float | None'Upper drill-hole tolerance in mils, or ``None`` when unset/N/A. property hole_size_mils -> 'float'Get hole size in mils. method is_copper_land_removed(self, layer: 'PcbLayer') -> 'bool'Return the stored removed-land state for one legacy copper layer. property is_smt -> 'bool'Check if this is an SMT pad. property is_through_hole -> 'bool'Check if this is a through-hole pad. method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this pad. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. method pad_center_internal_units(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[int, int]'Get copper pad center in internal units for a given layer. method pad_center_mils(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[float, float]'Get copper pad center in mils for a given layer. method pad_offset_internal_units(self, layer: 'PcbLayer | int | None' = None) -> 'tuple[int, int]'Get pad-center offset (internal units) for a given layer. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse PAD record from binary data. property paste_settings -> 'PcbPadPasteSettings | None'The paste settings of the main block's extension, read as property pastemask_expansion_mils -> 'float'Get pastemask expansion in mils (manual value). property record_type -> 'PcbRecordType'Return the PCB pad record discriminator. property removed_copper_layer_map_is_canonical -> 'bool'Return whether every persisted map byte is zero or one. property removed_copper_layers -> 'tuple[bool, ...]'Return removed-land state in legacy copper-layer order. property semantic_top_shape -> 'int'Return the first-class semantic top shape, including custom pads. method serialize_to_binary(self) -> 'bytes'Serialize PAD record to binary format. method set_copper_land_removed(self, layer: 'PcbLayer', removed: 'bool') -> 'None'Set one legacy copper-layer removed-land state. method set_hole_tolerances_mils(self, positive_mils: 'float | None', negative_mils: 'float | None') -> 'None'Set upper/lower drill-hole tolerances in mils. property soldermask_expansion_bottom -> 'int'The bottom side's solder mask expansion, internal units: the property soldermask_expansion_mils -> 'float'Get soldermask expansion in mils (manual value). property thermal_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) Kind Signature Summary classmethod from_record(cls, record: 'dict[str, Any]', source: 'bytes | None' = None) -> 'AltiumPcbPolygon'Parse polygon from Polygons6/Data text record. property layer_ref -> 'PcbLayerRef | None'The polygon's layer: `LAYER_V7` when saved, otherwise `LAYER`. method to_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) Kind Signature Summary property cavity_height_mils -> 'float'Cavity definition height in mils. property exact_outline -> "list['PcbRegionOutlineVertex']"The Region outline with its true arcs, in mils. property has_exact_arcs -> 'bool'True when the Region stores an exact outline with at least one arc. method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this region. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse REGION record from binary data. property record_type -> 'PcbRecordType'Return the PCB region record discriminator. property region_kind -> 'PcbRegionKind'Return the semantic public region kind for the native record fields. method serialize_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) Kind Signature Summary method can_passthrough_raw_payload(self) -> 'bool'classmethod from_record(cls, record: 'Mapping[str, object]', *, index: 'int' = 0, record_leader: 'bytes | None' = None, record_payload: 'bytes | None' = None) -> "'AltiumPcbRule'"method source_record(self) -> 'dict[str, str]'Return a serialized record view for downstream passthrough consumers. method to_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) Kind Signature Summary property cavity_height_mils -> 'float'Cavity definition height in mils. property hole_vertices -> 'list[list[PcbSimpleVertex]]'method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this shape-based region. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. property outline_vertices -> 'list[PcbExtendedVertex]'method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse ShapeBasedRegion record from binary data. property record_type -> 'PcbRecordType'Return the PCB region record discriminator. property region_kind -> 'PcbRegionKind'Return the semantic public region kind for this shape-based record. method serialize_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) Kind Signature Summary property barcode_full_height_mils -> 'float'Get barcode full height in mils. property barcode_full_width_mils -> 'float'Get barcode full width in mils. property barcode_min_width_mils -> 'float'Get barcode minimum bar width in mils. property effective_justification -> 'int'Get effective justification for rendering. property height_mils -> 'float'Get text height in mils. method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this text primitive. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse TEXT record from binary data. property record_type -> 'PcbRecordType'Return the PCB text record discriminator. method resolve_text_content(self, widestrings_table: 'dict[int, str]') -> 'None'Resolve text content from WideStrings6 table. method serialize_to_binary(self) -> 'bytes'Serialize TEXT record to binary format. property stroke_width_mils -> 'float'Get stroke width in mils. property textbox_rect_height_mils -> 'float'Get textbox rect height in mils. property textbox_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) Kind Signature Summary property end_x_mils -> 'float'Get end X in mils. property end_y_mils -> 'float'Get end Y in mils. method layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware layer identity for this track. method layer_state(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbPrimitiveLayerState'Return the V7-aware layer identity plus stored layer diagnostics. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse TRACK record from binary data. property record_type -> 'PcbRecordType'Return the PCB track record discriminator. method serialize_to_binary(self) -> 'bytes'Serialize TRACK record to binary format. property start_x_mils -> 'float'Get start X in mils. property start_y_mils -> 'float'Get start Y in mils. property width_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) Kind Signature Summary property diameter_mils -> 'float'Via diameter in mils. method end_layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware signal-layer ref for the via span end. method get_ipc4761_feature(self, feature_type: 'PcbViaStructureFeatureType | int') -> 'AltiumPcbViaStructureFeature | None'Return one IPC-4761 feature-table row attached to this via. property hole_negative_tolerance -> 'int'Lower drill-hole tolerance magnitude in internal units. property hole_negative_tolerance_mils -> 'float | None'Lower drill-hole tolerance magnitude in mils, or ``None`` when unset/N/A. property hole_positive_tolerance -> 'int'Upper drill-hole tolerance in internal units. property hole_positive_tolerance_mils -> 'float | None'Upper drill-hole tolerance in mils, or ``None`` when unset/N/A. property hole_size_mils -> 'float'Hole size in mils. method layer_span_refs(self, registry: 'PcbLayerRegistry | None' = None) -> 'tuple[PcbLayerRef, PcbLayerRef]'Return `(start_ref, end_ref)` for the via signal-layer span. property native_union_index -> 'int'The complete native `UnionIndex` dword at payload +70..+73. property neg_tolerance -> 'int'Alias for `hole_negative_tolerance`. method parse_from_binary(self, data: 'bytes', offset: 'int' = 0) -> 'int'Parse VIA record from binary data. property pos_tolerance -> 'int'Alias for `hole_positive_tolerance`. property propagation_delay -> 'float'Alias for `propagation_delay_ps`. property propagation_delay_ps -> 'float'Via propagation delay in picoseconds. property record_type -> 'PcbRecordType'Return the PCB via record discriminator. method remove_copper_lands(self, layers: 'Sequence[PcbLayerLike]') -> 'None'Remove the via's land on each copper layer, as Altium saves such a via: method serialize_to_binary(self) -> 'bytes'Serialize VIA record to binary format. method set_hole_tolerances_mils(self, positive_mils: 'float | None', negative_mils: 'float | None') -> 'None'Set upper/lower drill-hole tolerances in mils. method set_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. method set_ipc4761_feature_material(self, feature_type: 'PcbViaStructureFeatureType | int', material: 'str') -> 'AltiumPcbViaStructureFeature'Update the material column for one IPC-4761 feature-table row. method set_ipc4761_feature_side(self, feature_type: 'PcbViaStructureFeatureType | int', side: 'PcbViaStructureFeatureSide | int') -> 'AltiumPcbViaStructureFeature'Update the side column for one IPC-4761 feature-table row. method set_uniform_diameter_mils(self, diameter_mils: 'float') -> 'None'Set SIMPLE Via core and inline diameters together, in mils. property soldermask_expansion_linked -> 'bool'Deprecated inverse of ``uses_separate_mask_expansions``. property soldermask_expansion_manual -> 'bool'Derived: True when solder_mask_expansion_mode == 2 (Manual). property stackcr_use_percent_flags -> 'tuple[bool, ...]'Return StackCR use-percent lane booleans derived from raw lane tokens. method start_layer_ref(self, registry: 'PcbLayerRegistry | None' = None) -> 'PcbLayerRef'Return the V7-aware signal-layer ref for the via span start. property tents_by_rule -> 'bool'Whether the via's tenting follows the mask rule rather than its property thermal_profiles -> 'list[PcbPadThermalProfile] | None'The via's saved thermal relief profiles, in the pad entry form property uses_separate_mask_expansions -> 'bool'Whether the bottom solder-mask expansion is stored apart from the top. property x_mils -> 'float'X position in mils. property y_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) Kind Signature Summary method get_feature(self, feature_type: 'PcbViaStructureFeatureTypeValue') -> 'AltiumPcbViaStructureFeature | None'Return the row for an IPC-4761 feature type, if present. property ipc4761_via_type -> 'PcbIpc4761ViaTypeValue'property metadata -> 'str'method to_payload(self) -> 'bytes'method with_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
AltiumPcbViaStructureLink from altium_monkey import AltiumPcbViaStructureLink
class AltiumPcbViaStructureLink ( primitive_index: 'int' , via_structure_index: 'int' , properties: 'dict[str, str]' , raw_payload: 'bytes' ) -> 'None'
Link from a VIA primitive index to a via-structure manager record.
Members (1) Kind Signature Summary method to_payload(self) -> 'bytes'
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) Kind Signature Summary method to_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) Kind Signature Summary classmethod copper(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. classmethod core(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. classmethod dielectric(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. classmethod from_stack_layer(cls, layer: 'object') -> "'AltiumRigidStackRowSpec'"Copy an existing source-aware stack row into authored-row input. classmethod overlay(cls, name: 'str') -> "'AltiumRigidStackRowSpec'"Build an overlay/legend row. classmethod prepreg(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. classmethod solder_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) Kind Signature Summary property radius_mils -> 'float | None'Bend radius in mils, derived from the native raw coordinate value. method to_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) Kind Signature Summary property root_stack_ref -> 'str'method to_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method is_enabled_for_substack(self, source_stackup_ref: 'str') -> 'bool'method to_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) Kind Signature Summary property bending_line_count -> 'int'method to_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) Kind Signature Summary method to_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) Kind Signature Summary classmethod from_bytes(cls, data: 'bytes', *, source_path: 'str' = '') -> "'AltiumStackupDocument'"classmethod from_file(cls, path: 'str | Path') -> "'AltiumStackupDocument'"classmethod from_layer_stack_document(cls, document: "'AltiumLayerStackDocument'") -> "'AltiumStackupDocument'"Build a rigid `.stackup` interchange document from the common model. classmethod from_text(cls, text: 'str', *, source_path: 'str' = '') -> "'AltiumStackupDocument'"method to_debug_json(self) -> 'dict[str, object]'method to_layer_stack_document(self) -> "'AltiumLayerStackDocument'"Build an `AltiumLayerStackDocument` from the exported V8 LSM records. method to_record_mapping(self) -> 'dict[str, str]'method to_text(self) -> 'str'Serialize this document as Altium's pipe-delimited `.stackup` text. method write(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) Kind Signature Summary classmethod default(cls) -> "'AltiumStackupSettings'"Return Altium's default stackup-level electrical settings. classmethod from_stackup_attributes(cls, attributes: 'Sequence[tuple[str, str]]') -> "'AltiumStackupSettings'"Build typed settings from serialized StackupX/native attribute pairs. method to_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) Kind Signature Summary classmethod from_bytes(cls, data: 'bytes', *, source_path: 'str' = '') -> "'AltiumStackupXDocument'"classmethod from_embedded_bytes(cls, data: 'bytes') -> "'AltiumStackupXDocument'"Parse the StackupX XML a PcbDoc embeds in Board6 `V9_STACKCUSTOMDATA`. classmethod from_file(cls, path: 'str | Path') -> "'AltiumStackupXDocument'"classmethod from_layer_stack_document(cls, document: "'AltiumLayerStackDocument'") -> "'AltiumStackupXDocument'"Build a rigid `.stackupx` interchange document from the common model. classmethod from_text(cls, text: 'str', *, source_path: 'str' = '') -> "'AltiumStackupXDocument'"method stack_by_name(self, name: 'str') -> 'StackupXStack | None'property stack_names -> 'tuple[str, ...]'method to_bytes(self) -> 'bytes'Serialize this document as UTF-8 `.stackupx` XML bytes. method to_debug_json(self) -> 'dict[str, object]'method to_layer_stack_document(self) -> "'AltiumLayerStackDocument'"Build an `AltiumLayerStackDocument` view from proven StackupX fields. method to_text(self) -> 'str'Serialize this document as Altium `.stackupx` XML. method write(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) Kind Signature Summary method to_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) Kind Signature Summary classmethod arc(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. classmethod line(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) Kind Signature Summary method add_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'"method add_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'method add_component_body(self, body: 'AltiumPcbComponentBody', *, component_index: 'int | None' = None, guid: 'uuid.UUID | None' = None) -> "'PcbDocBuilder'"method add_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 method add_component_texts(self, component_index: 'int | None' = None) -> 'list[int]'Give a component, or every component, the Designator and Comment Texts method add_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. method add_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. method add_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. method add_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'"method add_embedded_font_record(self, raw_record: 'bytes') -> "'PcbDocBuilder'"Append one native ``EmbeddedFonts6/Data`` record. method add_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. method add_extended_primitive_information(self, item: 'AltiumPcbExtendedPrimitiveInformation') -> "'PcbDocBuilder'"method add_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'"method add_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. method add_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 method add_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'"method add_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. method add_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'"method add_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. method add_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'"method add_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'"method build_streams(self) -> 'dict[str, bytes]'property custom_mask_shapes -> 'tuple[PcbCustomMaskShape, ...]'The board's ``CustomMaskShapes`` records as the builder writes them. method filename(self) -> 'str'method filepath(self) -> 'Path'classmethod from_bytes(cls, data: 'bytes', filename: 'str | Path' = 'embedded.PcbDoc') -> "'PcbDocBuilder'"method get_mechanical_layer_kind(self, layer: 'int | str | PcbLayer') -> 'MechanicalLayerKind | None'Return the configured kind for a mechanical layer, if present. method has_stream(self, stream_name: 'str') -> 'bool'method is_open(self) -> 'bool'property mechanical_layer_kinds -> 'Mapping[int, MechanicalLayerKind]'Return the current mapping by LayerKindMapping/Data layer id. method place_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 method place_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'method read_stream(self, stream_name: 'str') -> 'bytes'method remove_component_parameter(self, component_index: 'int', name: 'str') -> "'PcbDocBuilder'"method remove_mechanical_layer_pairs_for(self, layers: 'Collection[int | str | PcbLayer]') -> "'PcbDocBuilder'"Remove all ``MECHPAIR*`` records referencing any layer in ``layers`` and compact indices. method remove_stream(self, stream_name: 'str') -> "'PcbDocBuilder'"method save(self, filepath: 'Path') -> 'Path'Build the PCB document streams and write them to disk. method set_2d_current_layer(self, layer_token: 'str') -> "'PcbDocBuilder'"method set_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). method set_3d_solder_mask_colors(self, *, top_color: 'int | None' = None, bottom_color: 'int | None' = None) -> "'PcbDocBuilder'"method set_advanced_placer_place_large_clear(self, value: 'str') -> "'PcbDocBuilder'"method set_advanced_placer_use_advanced_place(self, value: 'bool') -> "'PcbDocBuilder'"method set_board_outline(self, outline: 'AltiumBoardOutline') -> "'PcbDocBuilder'"Replace the board outline with explicit line/arc outline geometry. method set_component_description(self, component_index: 'int', description: 'str') -> "'PcbDocBuilder'"method set_component_parameter(self, component_index: 'int', name: 'str', value: 'str') -> "'PcbDocBuilder'"method set_config_2d_full_filename(self, value: 'str') -> "'PcbDocBuilder'"method set_config_3d_full_filename(self, value: 'str') -> "'PcbDocBuilder'"method set_constraint_manager_token(self, token: 'str') -> "'PcbDocBuilder'"method set_current_view_state(self, value: 'str | PcbDocViewState') -> "'PcbDocBuilder'"method set_design_rule_checker_max_violation_count(self, value: 'int') -> "'PcbDocBuilder'"method set_design_rule_checker_verify_shorting_copper(self, value: 'bool') -> "'PcbDocBuilder'"method set_layer_stack_document(self, document: "'AltiumLayerStackDocument'") -> "'PcbDocBuilder'"Apply a typed layer-stack document to a newly authored board. method set_layer_stack_template(self, template: 'PcbDocLayerStackTemplate | str') -> "'PcbDocBuilder'"method set_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. method set_mechanical_layer_kind(self, layer: 'int | str | PcbLayer', kind: 'int | str | MechanicalLayerKind') -> "'PcbDocBuilder'"Set the semantic kind assigned to a mechanical layer. method set_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. method set_origin_mils(self, x_mils: 'float', y_mils: 'float') -> "'PcbDocBuilder'"Set the board origin in mils. method set_origin_to_outline_lower_left(self) -> "'PcbDocBuilder'"Derive the board origin from the outline's lower-left bounds. method set_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. method set_outline_rectangle_mils(self, left: 'float', bottom: 'float', right: 'float', top: 'float') -> "'PcbDocBuilder'"Set the board outline to an axis-aligned rectangle in mils. method set_outline_vertices_mils(self, vertices_mils: 'Sequence[tuple[float, float]]') -> "'PcbDocBuilder'"Replace the board outline with an explicit polygon in mils. method set_pad_via_library_cache_display_units(self, value: 'int') -> "'PcbDocBuilder'"method set_pad_via_library_display_units(self, value: 'int') -> "'PcbDocBuilder'"method set_pad_via_library_name(self, value: 'str') -> "'PcbDocBuilder'"method set_pin_swap_crossover_ratio(self, value: 'int') -> "'PcbDocBuilder'"method set_pin_swap_via_penalty_state(self, value: 'bool') -> "'PcbDocBuilder'"method set_sheet_frame_mils(self, x_mils: 'float', y_mils: 'float', width_mils: 'float', height_mils: 'float') -> "'PcbDocBuilder'"method set_signal_class_kind(self, value: 'int') -> "'PcbDocBuilder'"method set_signal_class_name(self, value: 'str') -> "'PcbDocBuilder'"method set_signal_class_unique_id(self, value: 'str') -> "'PcbDocBuilder'"method set_stream(self, stream_name: 'str', data: 'bytes') -> "'PcbDocBuilder'"method set_stream_same_size(self, stream_name: 'str', data: 'bytes') -> "'PcbDocBuilder'"method set_viewport_bounds(self, lx: 'int', hx: 'int', ly: 'int', hy: 'int') -> "'PcbDocBuilder'"method stream_names(self) -> 'list[str]'method stream_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) Kind Signature Summary method to_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) Kind Signature Summary property reference -> 'tuple[int, int] | None'X, Y: where the origin-mode anchor of the first copy lands. property untransmitted_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) Kind Signature Summary property center_x_mils -> 'float'Arc center X in mils. property center_y_mils -> 'float'Arc center Y in mils. property is_round -> 'bool'False=line segment, True=arc. property radius_mils -> 'float'Arc radius in mils. property x_mils -> 'float'X position in mils. property y_mils -> 'float'Y position in mils.
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) Kind Signature Summary method board_region(self, region_id: 'int') -> 'PcbContextBoardRegion'method board_region_by_name(self, name: 'str') -> 'PcbLayerLookup[int]'The region named `name`; several regions of one name are ambiguous. property board_regions -> 'tuple[PcbContextBoardRegion, ...]'method by_token(self, token: 'str') -> 'PcbLayerLookup[int]'The layer a configuration token or display name names. method cavity_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. method component_mount(self, component: 'object') -> 'PcbLayerLookup[PcbLayerMount]'Where a parsed `AltiumPcbComponent` mounts, by its layer and position. method coverlay_outline(self, layer_id: 'int') -> 'tuple[int, PcbLayerFace] | None'The substack and face a coverlay outline layer belongs to. property diagnostics -> 'tuple[PcbLayerDiagnostic, ...]'What the context could not resolve. property drill_pairs -> 'tuple[PcbContextDrillPair, ...]'method drill_pairs_through(self, layer_id: 'int', substack_id: 'int') -> 'tuple[PcbContextDrillPair, ...]'The drill pairs that hold a copper layer in a substack. method enabled_in(self, layer_id: 'int', region_id: 'int') -> 'bool'Whether a layer exists in a board region's substack. method envelope(self, substack_id: 'int') -> 'PcbSubstackEnvelope'A substack's physical rows, top to bottom, and their depths. method face(self, layer_id: 'int', substack_id: 'int') -> 'PcbLayerFace | None'Where a layer sits in a substack. method hole_span(self, pair: 'PcbContextDrillPair', substack_id: 'int') -> 'tuple[int, ...]'The copper layers a drill pair passes through within a substack. method layer(self, layer_id: 'int') -> 'PcbContextLayer'method layer_metadata(self, ref: 'PcbLayerRef') -> 'PcbLayerMetadata | None'Id, key, name, token, kind and side of a layer, for renderers. property layers -> 'tuple[PcbContextLayer, ...]'Every layer, in stack order. method mount(self, ref: 'PcbLayerRef', x_mils: 'float', y_mils: 'float') -> 'PcbLayerLookup[PcbLayerMount]'Where an object on `ref` at a point mounts. property multilayer -> 'int'The logical MultiLayer of through pads and vias. method opposite(self, layer_id: 'int', substack_id: 'int') -> 'int | None'The layer in the mirrored position within a substack. method physical_row(self, row_id: 'int') -> 'PcbContextPhysicalRow'property physical_rows -> 'tuple[PcbContextPhysicalRow, ...]'Every physical row of the board's stack, top to bottom. method physical_side(self, layer_id: 'int', substack_id: 'int') -> 'PcbLayerFace | None'The board face of a layer within a substack. property primary -> 'int | None'The board's main substack. method region_at(self, x_mils: 'float', y_mils: 'float') -> 'int | None'The board region a point lies in, holes excluded. property registry -> 'PcbLayerRegistry'The board or library layer registry the context was built from. method resolve(self, ref: 'PcbLayerRef') -> 'PcbLayerLookup[int]'The layer an identity names. method side_of(self, layer_id: 'int') -> 'PcbLayerFace | None'The board face a layer belongs to by its own identity. method substack(self, substack_id: 'int') -> 'PcbContextSubstack'method substack_at(self, x_mils: 'float', y_mils: 'float') -> 'int | None'The substack that applies at a point: its region's, else the primary. method substack_of_region(self, region_id: 'int') -> 'PcbLayerLookup[int]'The substack a board region's construction follows. property substacks -> 'tuple[PcbContextSubstack, ...]'method surface_layers(self, substack_id: 'int', face: 'PcbLayerFace') -> 'PcbSurfaceLayers'The outer copper and the surface layers on one face of a substack. method via_span(self, start: 'PcbLayerRef', end: 'PcbLayerRef') -> 'PcbLayerLookup[PcbBoardViaSpan]'The board span of a via whose record stores `start` and `end`. method via_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) Kind Signature Summary property found -> '_T | None'The single answer, if there is exactly one. classmethod not_found(cls) -> 'PcbLayerLookup[_T]'classmethod of(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) Kind Signature Summary classmethod bottom(cls) -> "'PcbLayerRef'"classmethod from_legacy(cls, layer: 'int | PcbLayer') -> "'PcbLayerRef'"classmethod from_v7_saved_layer_id(cls, value: 'int') -> "'PcbLayerRef'"classmethod internal_plane(cls, number: 'int') -> "'PcbLayerRef'"property legacy_layer_id -> 'int | None'Return the legacy TV6 layer id when this ref is losslessly legacy. method matches(self, other: "'PcbLayerLike'") -> 'bool'Return whether `other` names this layer. classmethod mechanical(cls, number: 'int') -> "'PcbLayerRef'"classmethod mid_layer(cls, number: 'int') -> "'PcbLayerRef'"classmethod parse(cls, token: 'str', *, allow_native_tokens: 'bool' = False) -> "'PcbLayerRef'"method require_legacy_layer(self) -> 'PcbLayer'Return the legacy TV6 enum or raise when this ref is V7-only. classmethod top(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) Kind Signature Summary method coerce(self, value: 'PcbLayerLike', *, allow_native_tokens: 'bool' = False) -> 'PcbLayerRef'method entries_for_display_name(self, name: 'str') -> 'tuple[PcbLayerRegistryEntry, ...]'method entry_for_ref(self, ref: 'PcbLayerRef') -> 'PcbLayerRegistryEntry | None'method ref_for_legacy_layer(self, layer: 'int | PcbLayer') -> 'PcbLayerRef | None'method ref_for_runtime_v7_layer_id(self, value: 'int') -> 'PcbLayerRef | None'method ref_for_token(self, token: 'str') -> 'PcbLayerRef | None'method ref_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) Kind Signature Summary classmethod manual(cls, expansion_mils: 'float') -> "'PcbMaskExpansion'"Return a manual signed expansion value in mils. classmethod none(cls) -> "'PcbMaskExpansion'"Return raw mode zero; this does not reliably suppress Altium apertures. classmethod rule(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) Kind Signature Summary classmethod custom(cls) -> "'PcbPadMaskShapeSlot'"``CUSTOM`` at 0 by 0, centred; drawn as ``editor()`` is. classmethod editor(cls) -> "'PcbPadMaskShapeSlot'"``ROUND`` at 0 by 0, centred: the slot Altium's editor saves method properties(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) Kind Signature Summary property x_mils -> 'float'X position in mils. property y_mils -> 'float'Y position in mils.
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) Kind Signature Summary property diameter_iu -> 'int'property end_layer -> 'PcbLayer'classmethod from_via(cls, via: 'AltiumPcbVia', union_index: 'int') -> 'PcbSmartUnionTemplateVia'Encode a via as a template, in Altium 26.10's key order. property hole_size_iu -> 'int'property solder_mask_expansion_mode -> 'str'property start_layer -> 'PcbLayer'property template_link -> 'tuple[str, str] | None'method to_via(self) -> 'AltiumPcbVia'The template as an ordinary via record at its saved position. method with_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) Kind Signature Summary staticmethod is_copper_text(text: 'AltiumPcbText') -> 'bool'Classify native signal/plane/multilayer text, excluding document aliases. method render_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. method resolve_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) Kind Signature Summary property effective_row_spacing -> 'int'`row_spacing`, or the template diameter plus `row_step` 26.10 writes. property effective_via_pitch -> 'int'`via_pitch`, or the template diameter plus `step` 26.10 writes. classmethod from_record(cls, record: 'PcbSmartUnionRecord') -> 'PcbViaShieldingUnion | None'method member_vias(self, vias: 'Sequence[AltiumPcbVia]') -> 'tuple[AltiumPcbVia, ...]'method to_items(self) -> 'tuple[PcbSmartUnionItem, ...]'The record as Altium 26.10 writes it. property union_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) Kind Signature Summary classmethod from_record(cls, record: 'PcbSmartUnionRecord') -> 'PcbViaStitchingUnion | None'method member_vias(self, vias: 'Sequence[AltiumPcbVia]') -> 'tuple[AltiumPcbVia, ...]'method to_items(self) -> 'tuple[PcbSmartUnionItem, ...]'The record as Altium 26.10 writes it. property union_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) Kind Signature Summary method to_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) Kind Signature Summary method board_region_context_by_name(self, name: 'str') -> 'ResolvedBoardRegionContext | None'Lookup resolved region context by board-region name. method board_region_contexts_for_layerstack_id(self, layerstack_id: 'str') -> 'tuple[ResolvedBoardRegionContext, ...]'Return board regions bound to a given layerstack/substack GUID. method display_name_for_token(self, token: 'str') -> 'str | None'Resolve display name from standard token or direct display name. method drill_pairs_for_board_region(self, board_region_or_layerstack_id: 'Any') -> 'tuple[ResolvedDrillPair, ...]'Return drill spans valid for a board region or layerstack GUID. method drill_pairs_for_substack(self, source_stackup_ref: 'str') -> 'tuple[ResolvedDrillPair, ...]'Return drill spans valid for the requested substack. method layer_by_legacy_id(self, legacy_id: 'int') -> 'ResolvedLayer | None'Lookup layer by legacy primitive layer ID. method layer_by_name(self, name: 'str') -> 'ResolvedLayer | None'Lookup layer by display name. method layer_by_token(self, token: 'str') -> 'ResolvedLayer | None'Lookup layer by standard token or display-name token. method layer_by_v7_id(self, v7_id: 'int') -> 'ResolvedLayer | None'Lookup layer by exact saved V7 layer ID. method layer_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. method layer_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. method layers_for_board_region(self, board_region_or_layerstack_id: 'Any') -> 'tuple[ResolvedLayer, ...]'Return enabled physical layers for a board region or layerstack GUID. method layers_for_substack(self, source_stackup_ref: 'str') -> 'tuple[ResolvedLayer, ...]'Return enabled physical layers for the requested substack. method resolve_layer_name(self, legacy_id: 'int') -> 'str'Resolve legacy layer ID to display name. method stack_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. method stack_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. method standard_layer_name(self, token: 'str') -> 'str | None'Resolve a canonical standard token like TOPSOLDER or MID1. method substack_by_name(self, name: 'str') -> 'ResolvedSubstack | None'Lookup resolved substack by display name. method substack_by_source_ref(self, source_stackup_ref: 'str') -> 'ResolvedSubstack | None'Lookup resolved substack by native Altium stackup GUID. method substack_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method to_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) Kind Signature Summary method to_debug_json(self) -> 'dict[str, object]'property transmission_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) Kind Signature Summary property family -> 'str'property property_map -> 'dict[str, StackupXProperty]'method property_value(self, name: 'str') -> 'str'property thickness_mils -> 'float | None'method to_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) Kind Signature Summary property length_mils -> 'float | None'method to_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) Kind Signature Summary method to_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) Kind Signature Summary property copper_layer_names -> 'tuple[str, ...]'property layer_names -> 'tuple[str, ...]'method to_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) Kind Signature Summary method to_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) Kind Signature Summary member NONE= 0member BODY_UP= 1member BODY_DOWN= 2
enum
AltiumDielectricLayerKind from altium_monkey import AltiumDielectricLayerKind
enum AltiumDielectricLayerKind
Layer Stack Manager dielectric row kind for authored rigid stacks.
Members (3) Kind Signature Summary member CORE= 0member PREPREG= 2member COVERLAY= 4
enum
AltiumStackupRoughnessModel from altium_monkey import AltiumStackupRoughnessModel
enum AltiumStackupRoughnessModel
Layer Stack Manager conductor roughness model.
Members (6) Kind Signature Summary member NO_ROUGHNESS= 'NoRoughness'member MODIFIED_HAMMERSTAD= 'MHammerstad'member HURAY_SNOWBALL= 'HuraySnowball'member MODIFIED_GROISS= 'MGroiss'member HEMISPHERICAL= 'Hemispherical'member HURAY_BRACKEN= 'HurayBracken'
enum
AltiumStackupType from altium_monkey import AltiumStackupType
enum AltiumStackupType
Layer Stack Manager stackup type.
Members (2) Kind Signature Summary member STANDARD= 'Standard'member PRINTED= '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) Kind Signature Summary member UNDEFINED= 0member ASSEMBLY_TOP= 1member ASSEMBLY_BOTTOM= 2member ASSEMBLY_NOTES= 3member BOARD= 4member COATING_TOP= 5member COATING_BOTTOM= 6member COMPONENT_CENTER_TOP= 7member COMPONENT_CENTER_BOTTOM= 8member COMPONENT_OUTLINE_TOP= 9member COMPONENT_OUTLINE_BOTTOM= 10member COURTYARD_TOP= 11member COURTYARD_BOTTOM= 12member DESIGNATOR_TOP= 13member DESIGNATOR_BOTTOM= 14member DIMENSIONS= 15member DIMENSIONS_TOP= 16member DIMENSIONS_BOTTOM= 17member FAB_NOTES= 18member GLUE_POINTS_TOP= 19member GLUE_POINTS_BOTTOM= 20member GOLD_PLATING_TOP= 21member GOLD_PLATING_BOTTOM= 22member VALUE_TOP= 23member VALUE_BOTTOM= 24member VCUT= 25member BODY_3D_TOP= 26member BODY_3D_BOTTOM= 27member ROUTE_TOOL_PATH= 28member SHEET= 29member BOARD_SHAPE= 30member OVERLAY_TOP= 31member OVERLAY_BOTTOM= 32member SOLDER_TOP= 33member SOLDER_BOTTOM= 34member PASTE_TOP= 35member PASTE_BOTTOM= 36member TENTING_TOP= 37member TENTING_BOTTOM= 38member COVERING_TOP= 39member COVERING_BOTTOM= 40member PLUGGING_TOP= 41member PLUGGING_BOTTOM= 42member FILLING= 43member CAPPING= 44member DIE_PADS_TOP= 45member DIE_PADS_BOTTOM= 46member WIREBONDING_TOP= 47member WIREBONDING_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) Kind Signature Summary member ROUND= 0member SQUARE= 1member SLOT= 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) Kind Signature Summary member CIRCLE= 1member RECTANGLE= 2member OCTAGONAL= 3member ROUNDED_RECTANGLE= 4member CUSTOM= 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) Kind Signature Summary member CODE_39= 0member CODE_128= 1member QR_CODE= 2member DATA_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) Kind Signature Summary member BY_MIN_WIDTH= 0member BY_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) Kind Signature Summary member TOP= 0member BOTTOM= 1member BOTH= 2member NONE= 3
enum
PcbDielectricType from altium_monkey. altium_pcb_layer_context import PcbDielectricType
enum PcbDielectricType
Altium's dielectric type, the native Board6 `DIELTYPE`.
Members (5) Kind Signature Summary member NO_DIELECTRIC= 0member CORE= 1member PREPREG= 2member SURFACE_MATERIAL= 3member FILM= 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) Kind Signature Summary member REGULAR= 0member MICRO_VIA= 1member BACKDRILL= 2member COUNTER_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) Kind Signature Summary member FIELD_ABSENT= 'embedded_board_field_absent'member FIELD_UNREADABLE= 'embedded_board_field_unreadable'member ORIGIN_MODE_UNCONFIRMED= 'embedded_board_origin_mode_unconfirmed'member RECORDS_IGNORED= 'embedded_board_records_ignored'member RECORDS_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) Kind Signature Summary member ERROR= 'error'member WARNING= '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) Kind Signature Summary member ARRAY= 'array'member VIEWPORT= '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) Kind Signature Summary member BOARD_ORIGIN= 0member BOTTOM_LEFT= 1
enum
PcbIpc4761ViaType from altium_monkey import PcbIpc4761ViaType
enum PcbIpc4761ViaType
Altium IPC-4761 via-protection type.
Members (13) Kind Signature Summary member NONE= 0member TYPE_1A_TENTING= 1member TYPE_1B_TENTING= 2member TYPE_2A_TENTING_AND_COVERING= 3member TYPE_2B_TENTING_AND_COVERING= 4member TYPE_3A_PLUGGING= 5member TYPE_3B_PLUGGING= 6member TYPE_4A_PLUGGING_AND_COVERING= 7member TYPE_4B_PLUGGING_AND_COVERING= 8member TYPE_5_FILLING= 9member TYPE_6A_FILLING_AND_COVERING= 10member TYPE_6B_FILLING_AND_COVERING= 11member TYPE_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) Kind Signature Summary member VIA= 1member TRACK= 2member COPPER= 4member SMD_PAD= 8member TH_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) Kind Signature Summary member TOP= 1member MID1= 2member MID2= 3member MID3= 4member MID4= 5member MID5= 6member MID6= 7member MID7= 8member MID8= 9member MID9= 10member MID10= 11member MID11= 12member MID12= 13member MID13= 14member MID14= 15member MID15= 16member MID16= 17member MID17= 18member MID18= 19member MID19= 20member MID20= 21member MID21= 22member MID22= 23member MID23= 24member MID24= 25member MID25= 26member MID26= 27member MID27= 28member MID28= 29member MID29= 30member MID30= 31member BOTTOM= 32member TOP_OVERLAY= 33member BOTTOM_OVERLAY= 34member TOP_PASTE= 35member BOTTOM_PASTE= 36member TOP_SOLDER= 37member BOTTOM_SOLDER= 38member INTERNAL_PLANE_1= 39member INTERNAL_PLANE_2= 40member INTERNAL_PLANE_3= 41member INTERNAL_PLANE_4= 42member INTERNAL_PLANE_5= 43member INTERNAL_PLANE_6= 44member INTERNAL_PLANE_7= 45member INTERNAL_PLANE_8= 46member INTERNAL_PLANE_9= 47member INTERNAL_PLANE_10= 48member INTERNAL_PLANE_11= 49member INTERNAL_PLANE_12= 50member INTERNAL_PLANE_13= 51member INTERNAL_PLANE_14= 52member INTERNAL_PLANE_15= 53member INTERNAL_PLANE_16= 54member DRILL_GUIDE= 55member KEEPOUT= 56member MECHANICAL_1= 57member MECHANICAL_2= 58member MECHANICAL_3= 59member MECHANICAL_4= 60member MECHANICAL_5= 61member MECHANICAL_6= 62member MECHANICAL_7= 63member MECHANICAL_8= 64member MECHANICAL_9= 65member MECHANICAL_10= 66member MECHANICAL_11= 67member MECHANICAL_12= 68member MECHANICAL_13= 69member MECHANICAL_14= 70member MECHANICAL_15= 71member MECHANICAL_16= 72member DRILL_DRAWING= 73member MULTI_LAYER= 74member CONNECT= 75
enum
PcbLayerFace from altium_monkey. altium_pcb_layer_context import PcbLayerFace
enum PcbLayerFace
Where a layer sits in a substack.
Members (3) Kind Signature Summary member TOP= 'top'member BOTTOM= 'bottom'member INNER= 'inner'
enum
PcbLayerFamily from altium_monkey import PcbLayerFamily
enum PcbLayerFamily
Broad PCB layer family for V7-aware layer references.
Members (9) Kind Signature Summary member NO_LAYER= 'no_layer'member SIGNAL= 'signal'member INTERNAL_PLANE= 'internal_plane'member MECHANICAL= 'mechanical'member MISC= 'misc'member DIELECTRIC= 'dielectric'member DOCUMENT= 'document'member FAMILY= 'family'member UNKNOWN= 'unknown'
enum
PcbLayerKind from altium_monkey. altium_pcb_layer_context import PcbLayerKind
enum PcbLayerKind
What a layer is.
Members (13) Kind Signature Summary member COPPER= 'copper'member PLANE= 'plane'member SOLDER_MASK= 'solder_mask'member SOLDER_PASTE= 'solder_paste'member OVERLAY= 'overlay'member MECHANICAL= 'mechanical'member DRILL_DRAWING= 'drill_drawing'member DRILL_GUIDE= 'drill_guide'member KEEP_OUT= 'keep_out'member MULTI_LAYER= 'multi_layer'member COVERLAY= 'coverlay'member DIELECTRIC= 'dielectric'member OTHER= '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) Kind Signature Summary member FOUND= 'found'member NOT_FOUND= 'not_found'member AMBIGUOUS= '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) Kind Signature Summary member ANY= 0member NAME_NO_TYPE= 1member NAME_WITH_TYPE= 2member FULL_PATH= 3member VAULT_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) Kind Signature Summary member NONE= 0member RULE= 1member MANUAL= 2
enum
PcbNetClassKind from altium_monkey import PcbNetClassKind
enum PcbNetClassKind
PCB net-class family kind.
Members (7) Kind Signature Summary member NET= 0member COMPONENT= 1member FROM_TO= 2member PAD= 3member LAYER= 4member DIFF_PAIR= 6member POLYGON= 7
enum
PcbPhysicalRowFamily from altium_monkey. altium_pcb_layer_context import PcbPhysicalRowFamily
enum PcbPhysicalRowFamily
What a physical stack row is made of.
Members (14) Kind Signature Summary member COPPER= 'copper'member PLANE= 'plane'member DIELECTRIC= 'dielectric'member ADHESIVE= 'adhesive'member STIFFENER= 'stiffener'member COVERLAY= 'coverlay'member SOLDER_MASK= 'solder_mask'member SOLDER_PASTE= 'solder_paste'member OVERLAY= 'overlay'member SURFACE_FINISH= 'surface_finish'member PLATING= 'plating'member MARKING= 'marking'member MISC= 'misc'member OTHER= '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) Kind Signature Summary member ARC= 1member PAD= 2member VIA= 3member TRACK= 4member TEXT= 5member FILL= 6member REGION= 11member COMPONENT_BODY= 12member MODEL= 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) Kind Signature Summary member COPPER= 0member BOARD_CUTOUT= 1member POLYGON_CUTOUT= 2member DASHED_OUTLINE= 3member UNKNOWN_3= 4member CAVITY_DEFINITION= 5member UNKNOWN= 99
enum
PcbSignalLayerKind from altium_monkey import PcbSignalLayerKind
enum PcbSignalLayerKind
Signal-layer role independent of encoded native integers.
Members (3) Kind Signature Summary member TOP= 'top'member MID= 'mid'member BOTTOM= 'bottom'
enum
PcbSmartUnionKind from altium_monkey. altium_pcbdoc_unions import PcbSmartUnionKind
enum PcbSmartUnionKind
Altium's SmartUnion object type, the record's UNIONTYPE.
Members (11) Kind Signature Summary member UNKNOWN= 0member DRILL_TABLE= 1member VIA_STITCHING= 2member LAYER_STACK_TABLE= 3member ACCORDION= 4member METADATA= 5member VIA_SHIELDING= 6member MULTILINE_TEXT= 7member ACCORDION_DIFFERENTIAL_PAIR= 8member RECTANGLE= 9member REUSE_BLOCK= 10
enum
PcbSubstackKind from altium_monkey. altium_pcb_layer_context import PcbSubstackKind
enum PcbSubstackKind
The construction of a substack.
Members (3) Kind Signature Summary member RIGID= 'rigid'member FLEX= 'flex'member OTHER= '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) Kind Signature Summary member MANUAL= 0member TOP_LEFT= 1member CENTER_LEFT= 2member BOTTOM_LEFT= 3member TOP_CENTER= 4member CENTER_CENTER= 5member BOTTOM_CENTER= 6member TOP_RIGHT= 7member CENTER_RIGHT= 8member BOTTOM_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) Kind Signature Summary member MANUAL= 0member LEFT_TOP= 1member LEFT_CENTER= 2member LEFT_BOTTOM= 3member CENTER_TOP= 4member CENTER_CENTER= 5member CENTER_BOTTOM= 6member RIGHT_TOP= 7member RIGHT_CENTER= 8member RIGHT_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) Kind Signature Summary member STROKE= 'stroke'member TRUETYPE= 'truetype'member BARCODE= 'barcode'
enum
PcbUnlinkedCustomPadBodyReason from altium_monkey import PcbUnlinkedCustomPadBodyReason
enum PcbUnlinkedCustomPadBodyReason
Why a saved PADINDEX links its record to no pad.
Members (2) Kind Signature Summary member NAMES_NO_PAD= 'names_no_pad'member UNREADABLE= 'unreadable'
enum
PcbViaMode from altium_monkey import PcbViaMode
enum PcbViaMode
Via stack-mode encoding.
Members (4) Kind Signature Summary member SIMPLE= 0member LOCAL_STACK= 1member EXTERNAL_STACK= 2member RESERVED_3= 3
enum
PcbViaStructureFeatureSide from altium_monkey import PcbViaStructureFeatureSide
enum PcbViaStructureFeatureSide
Altium IPC-4761 via-structure feature side.
Members (3) Kind Signature Summary member TOP= 0member BOTTOM= 1member BOTH= 2
enum
PcbViaStructureFeatureType from altium_monkey import PcbViaStructureFeatureType
enum PcbViaStructureFeatureType
Altium IPC-4761 via-structure feature type.
Members (5) Kind Signature Summary member TENTING= 0member COVERING= 1member PLUGGING= 2member FILLING= 3member CAPPING= 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) Kind Signature Summary member STANDARD_STACKUP= 'c8939e8a-fd0e-4d52-8860-b7a98f452016'member IMPEDANCE_CALCULATOR= 'e3df2b86-5f1b-49ca-b266-d1ae57f0ba6f'member RIGID_FLEX= '5277e6a4-9e5f-4f54-951f-dc18cfeb7530'member RIGID_FLEX_ADVANCED= '4e697926-85c3-4c60-8b9b-e23ccb226764'member BACK_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) Kind Signature Summary member ABSTRACT= '5ee2359d-ad77-4dad-bd77-5a2334695235'member UNKNOWN= '4af561f4-6919-43d8-942a-d3579b371c26'member PHYSICAL= 'daa9eccc-0064-462d-854e-0b9e829ef563'member BASE_DIELECTRIC= '56eb1ca5-014a-4387-a43e-1485f44f081e'member OVERLAY= 'c7ef040e-8d00-490b-b00c-a7e7823ff174'member BIKINI_COVERLAY= '8de65238-89ed-47c5-bbf8-0f6f02d1899c'member PASTE_MASK= 'e6a36257-b90f-45e5-9f8d-a213ecdb687c'member MECHANICAL= '7a47e6b3-b591-41f7-a27b-8c6b0477e458'member SOLDER_MASK= '7b384237-13d8-4318-8bcb-accd8d9a51e7'member COPPER_FOIL= '31e48829-e750-4c28-95e0-1a8313f0158e'member COPPER_SIGNAL= 'f4eccd87-2cfb-4f37-be50-4f3a272b4d01'member INTERNAL_PLANE= 'f59fab94-c5ed-467d-94cd-f60a323c5d5b'member SURFACE_FINISH= 'b0827674-798c-4cf8-807c-8e6c2a11c145'member DIELECTRIC= '92b02d5e-8d69-48a8-880e-ac4b77db099d'member PREPREG= '1a79611a-039d-4d40-a204-53c26c50f8b5'member CORE= '136c62ef-1fa6-4897-ae71-7e797b632b92'member PLATING= '90b89aa0-a48a-45f4-82f5-b3eca4ec8cce'member ADHESIVE= '448f9952-79ba-41d8-a8f4-4713ee7a3828'member STIFFENER= '9fd889fa-c97a-401c-a066-e5f746678381'member MISC= '786b5f28-f093-4084-bba7-46e8f4f24f55'member MARKING= '886956f5-b2e9-4114-93f3-f69af872bffb'member PRINTED_ELECTRONICS_LAYER= '8053a284-8886-43e8-baa0-5aa1d8de97d1'member PRINTED_ELECTRONICS_CONDUCTIVE= 'c558fe3f-d914-4761-9d82-a12591ceb133'member PRINTED_ELECTRONICS_NONCONDUCTIVE= '18be3c27-bfeb-4bba-8e9a-df4caeee1731'member PRINTED_ELECTRONICS_ISOLATION= '8590cc63-42d8-48cb-8307-72991910bcc9'member PRINTED_ELECTRONICS_CORE= 'e9a93ad8-17ee-438c-a1b6-92a3995dfda8'member PRINTED_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.