AltiumSchDoc, AltiumSchLib, record classes, enums, and mil-based factories.
149 / 149 shown
class
AltiumSchArc
from altium_monkey importAltiumSchArc
classAltiumSchArc()->'None'
Circular arc record.
Arc defined by center, radius, start/end angles.
Public code should use ``location_mils`` and ``radius_mils`` for geometry updates. The raw ``radius`` / ``radius_frac`` fields are internal coord-style storage fields kept for serializer fidelity.
Rendering depends on angle field presence, not only numeric angle values: explicit ``EndAngle=90`` is a true quarter arc, while a missing persisted ``EndAngle`` is handled as native missing-field state during SVG/IR export.
Public code should use ``points_mils`` for normal bezier creation, inspection, and mutation. Bezier points use cubic segments with native control-point groups of ``4 + 3n`` points: four points for the first segment, then three more points for each connected segment. Native V5 bezier records do not carry a line-style field.
Attributes: filepath: Path to SchDoc file sheet: SHEET record (root container with font table) components: List of placed component instances (AltiumSchComponent with children) wires: List of wire connections buses: List of bus connections net_labels: List of net labels power_ports: List of power/ground symbols junctions: List of wire junctions ports: List of hierarchical ports sheet_symbols: List of hierarchical sheet boxes graphics: List of sheet-level graphical objects labels: List of sheet-level text labels embedded_images: Dict of embedded images all_objects: List of all parsed objects (preserves file order)
Members (87)
Kind
Signature
Summary
method
add_component(self, lib_reference: 'str', designator: 'str' = 'U?', x: 'int' = 0, y: 'int' = 0, library_path: 'str' = '*', orientation: 'int' = 0, is_mirrored: 'bool' = False, part_id: 'int' = 1, part_count: 'int | None' = None, display_mode: 'int' = 0, display_mode_count: 'int' = 1, designator_x: 'int' = 0, designator_y: 'int' = 100, comment_x: 'int' = 0, comment_y: 'int' = -100) -> 'AltiumSchComponent'
Add a placed component and return the live component record.
Export the explicit versioned SchDoc interoperability envelope.
property
wires -> 'ObjectCollection'
class
AltiumSchEllipse
from altium_monkey importAltiumSchEllipse
classAltiumSchEllipse()->'None'
Ellipse/circle record.
Ellipse defined by center (location) and radii.
Public code should use ``location_mils``, ``radius_mils``, and ``secondary_radius_mils`` for geometry updates. The raw radius fields are internal coord-style storage fields kept for serializer fidelity.
Public code should use ``location_mils``, ``radius_mils``, and ``secondary_radius_mils`` for geometry updates. The raw radius fields are internal coord-style storage fields kept for serializer fidelity.
`image_data` stores the raw payload from the SchDoc Storage stream for preservation. For some Altium files that payload is a BMP preview plus a native image payload. Use `AltiumSchDoc.extract_embedded_images(...)` when exporting standalone image files.
Members (10)
Kind
Signature
Summary
property
border_color -> 'ColorValue | None'
Public border color helper.
property
bounds_mils -> 'SchRectMils'
Public image bounds helper expressed in mils.
method
detect_format(self) -> 'str | None'
Detect the raw `image_data` storage format from header bytes.
property
embedded -> 'bool'
Alias for embed_image.
property
height -> 'float'
Height in low-level schematic record units (10 mil per whole unit).
Export the explicit versioned SchLib interoperability envelope.
class
AltiumSchLine
from altium_monkey importAltiumSchLine
classAltiumSchLine()->'None'
Line segment record.
Single straight line from location to corner.
Public code should use ``location_mils`` and ``corner_mils`` for geometry updates, plus ``line_width`` and ``line_style`` for stroke properties. The raw coord fields are internal serializer-facing storage.
Supports line styles (solid, dashed, dotted, dash-dot) via ``LineStyle`` and ``LineStyleExt`` fields.
Public code should use ``points_mils`` for normal polygon mutation and inspection, plus ``line_width``, ``is_solid``, and ``transparent`` for stroke/fill state. Raw vertex coords remain internal serializer-facing storage.
Multi-segment graphical path with optional endpoint decorations.
Public code should normally mutate: - ``points_mils`` for vertex coordinates - ``line_width`` for stroke thickness - ``line_style`` for dash pattern - ``start_line_shape`` / ``end_line_shape`` for endpoint markers - ``line_shape_size`` for the native endpoint marker size state
``line_shape_size`` deliberately reuses the public ``LineWidth`` enum. That is a naming compromise, not a file-format coincidence: native Altium stores polyline endpoint marker size through the same four-step size model used for schematic line widths.
Generic hierarchical port (connects hierarchical blocks).
TEXT FIELDS: - Name: Port name/label displayed inside the port body (e.g., "DATA_IN", "CLK_OUT") - Text: Cross-reference text (displayed when cross-reference mode is enabled)
When CrossReference is hidden (CrossReference=F), the Name field is rendered. When CrossReference is shown (CrossReference=T), the Text field is rendered.
PROPERTIES: Direct properties: - Style: power symbol style (0-10) - ShowNetName: bool - whether to display net name
Label-like properties: - Text: string - net name (e.g., "VCC", "GND") - FontId: int - font ID for text - Orientation: rotation by 90-degree steps (0-3) - Justification: text alignment (0-8) - IsMirrored: bool - text mirrored - OverrideDisplayString: string - override display text
Effective native drawing; unnamed imported bytes draw as a bar.
property
style_code -> 'int'
Exact native byte, independent of its effective drawing.
property
style_is_known -> 'bool'
class
AltiumSchRectangle
from altium_monkey importAltiumSchRectangle
classAltiumSchRectangle()->'None'
Rectangle record.
Rectangle from location to corner with optional fill and stroke.
Public code should use ``location_mils``, ``corner_mils``, and ``bounds_mils`` for geometry updates. Use ``line_width``, ``line_style``, ``is_solid``, and ``transparent`` for stroke/fill state. The raw coord fields remain internal serializer-facing storage.
from altium_monkey importAltiumSchRoundedRectangle
classAltiumSchRoundedRectangle()->'None'
Rounded rectangle record.
Rectangle with rounded corners.
Public code should use ``location_mils``, ``corner_mils``, and ``bounds_mils`` for geometry updates. Use ``corner_x_radius_mils`` and ``corner_y_radius_mils`` for rounded-corner updates, plus ``line_width`` and ``is_solid`` for stroke/fill state. The raw coord-style corner-radius fields remain internal serializer-facing storage.
Port tab on hierarchical sheet symbol (connects to PORT in sub-sheet). Inherits from Altium's basic entry in native which provides: - Name, TextFontID, TextStyle, HarnessType, Side, DistanceFromTop
Members (5)
Kind
Signature
Summary
property
display_name -> 'str'
Get the name to display (name field takes precedence).
Multi-line text with border, word wrapping, and clipping.
Attributes: text: Text content (lines separated by ~1; ~1~1 = empty line) font_id: Font reference ID corner: Bottom-right corner coordinate alignment: Horizontal alignment (0=Left, 1=Center, 2=Right) word_wrap: Enable automatic word wrapping clip_to_rect: Clip text at frame boundaries show_border: Draw border rectangle is_solid: Fill background with area_color line_width: Border line width (LineWidth enum) text_margin: Margin from frame edges (internal units) text_margin_frac: Fractional part of margin text_color: Text color (Win32 BGR), None for default black
New code should create symbols through ``AltiumSchLib.add_symbol(...)`` instead of constructing ``AltiumSymbol(...)`` directly. Direct construction is a low-level parser/authoring detail and should generally be reserved for ``altium_monkey`` internals and tightly scoped conversion code.
Objects are stored in a single authoritative collection. ``.objects`` and typed convenience properties (``.pins``, ``.graphic_primitives``, ``.rectangles``, etc.) return live read-only views. Use the symbol's explicit add/remove APIs to change membership.
Each None keeps Altium's own rule: the system clock for ``CurrentDate`` and ``CurrentTime``, the source file's write date for ``ModifiedDate``, the page's source path for the displayed document path (``=DocumentFullPathAndName`` and the title-block File field), and the standalone automatic junction palette (navy). ``wrap_components`` wraps each component's drawing in one SVG group that names its source; the Paint IR is unchanged.
class
SchematicGraphicsUnavailable
from altium_monkey.altium_schematic_graphics importSchematicGraphicsUnavailable
classSchematicGraphicsUnavailable
A specifically admitted unsupported display capability prevents this scene.
class
SchematicPrintOutput
from altium_monkey.altium_outjob importSchematicPrintOutput
Authored text/box coordinates in mils, without rendered or electrical meaning.
owner_index is the existing parsed native source index, not template proof or a governed model reference. A missing/unparsable stored value may normalize to zero in the reader. A Note's author preserves its string, including empty.
This boundary type lets high-level object factories describe text styling without exposing document font-table details. The document resolves the specification to a concrete `font_id` when the object is added.
This is the preferred public coordinate boundary type for schematic mutation/factory APIs. It keeps the public contract in mils while still leaving room for explicit `from_mm(...)` construction later.
Public schematic rectangle helper expressed in mils.
The rectangle stores two opposite corners and normalizes them on demand. This makes it suitable for user-facing note/text-frame/style APIs where the caller should not need to care about the internal corner ordering.
Typed details for a schematic symbol extractable asset.
constant
ALTIUM_PORTABLE_FONT_REPLACEMENTS
from altium_monkey importALTIUM_PORTABLE_FONT_REPLACEMENTS
ALTIUM_PORTABLE_FONT_REPLACEMENTS: tuple
enum
BusTextStyle
from altium_monkey importBusTextStyle
enum BusTextStyle
Bus/harness text display style.
Members (2)
Kind
Signature
Summary
member
FULL= 0
member
PREFIX= 1
enum
DocumentBorderStyle
from altium_monkey importDocumentBorderStyle
enum DocumentBorderStyle
Title block style enum.
Stored values: - 0: Standard Altium title block - 1: ANSI Y14.1 title block
Note: Despite the enum name, this controls title block style, not border on/off. Border visibility is controlled by the separate 'border_on' property.
Members (2)
Kind
Signature
Summary
member
STANDARD= 0
member
ANSI= 1
function
embedded_asset_schema_id
from altium_monkey import embedded_asset_schema_id
defembedded_asset_schema_id()->'str'
Return the current embedded asset inventory JSON schema id.
function
extractable_asset_schema_id
from altium_monkey import extractable_asset_schema_id
defextractable_asset_schema_id()->'str'
Return the current extractable asset inventory JSON schema id.
enum
IeeeSymbol
from altium_monkey importIeeeSymbol
enum IeeeSymbol
IEEE symbol types for pin decorations.
Used for symbol_inner, symbol_outer, symbol_inner_edge, symbol_outer_edge. These decorations indicate signal characteristics (clock, active low, etc.).
Args: center_mils: Arc center point in mils. radius_mils: Arc radius in mils. Must be greater than zero. start_angle_degrees: Arc start angle in degrees. end_angle_degrees: Arc end angle in degrees. color: Optional arc stroke color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. line_width: Arc stroke thickness enum. Defaults to ``LineWidth.SMALL`` to match Altium's native new-arc default.
Returns: A detached ``AltiumSchArc`` ready to be added with ``schdoc.add_object(...)``.
Args: points_mils: Ordered cubic bezier control points in mils. Native schematic beziers use ``4 + 3n`` points: four points for the first segment, then three more for each connected segment. color: Optional bezier stroke color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. line_width: Bezier stroke thickness enum. Defaults to ``LineWidth.SMALL`` to match Altium's native new-bezier default.
Returns: A detached ``AltiumSchBezier`` ready to be added with ``schdoc.add_object(...)``.
Notes: Native V5 bezier serialization does not carry a line-style field, so the public factory intentionally omits any ``line_style`` parameter.
Args: points_mils: Ordered blanket polygon vertices in mils. At least three points are required. color: Optional blanket border color helper. ``None`` clears the persisted border-color field. fill_color: Optional blanket fill color helper. ``None`` clears the persisted area-color field. line_width: Blanket border thickness enum. Defaults to ``LineWidth.SMALLEST`` to match Altium's native new-blanket default. line_style: Blanket border dash pattern enum. Defaults to ``LineStyle.DASHED`` to match Altium's native new-blanket default. fill_background: Session/rendering compatibility control. V5 blanket records do not persist this value. transparent_fill: Session/rendering compatibility control. V5 blanket records do not persist this value. collapsed: Whether the blanket starts in its collapsed display state.
Returns: A detached ``AltiumSchBlanket`` ready to be added with ``schdoc.add_object(...)``.
Args: points_mils: Ordered bus path points in mils. At least two points are required. color: Optional bus color helper. ``None`` clears the persisted bus color field. line_width: Bus line thickness enum. The public ``MEDIUM`` default is an authoring API override of the low-level managed ``SMALL`` default.
Returns: A detached ``AltiumSchBus`` ready to be added with ``schdoc.add_object(...)``.
Args: start_mils: Start point in mils. end_mils: End point in mils. color: Optional bus-entry color helper. ``None`` clears the persisted bus-entry color field. line_width: Bus-entry line thickness enum. The public ``SMALLEST`` default is an authoring API override of the low-level managed ``SMALL`` default.
Returns: A detached ``AltiumSchBusEntry`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached schematic ellipse or full ellipse outline.
Args: center_mils: Ellipse center point in mils. radius_mils: Primary ellipse radius in mils. Must be greater than zero. secondary_radius_mils: Secondary ellipse radius in mils. Must be greater than zero. color: Optional ellipse stroke color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. fill_color: Optional fill color helper. ``None`` omits the persisted area-color field, whose V5 reopen semantic is black. line_width: Ellipse stroke thickness enum. Defaults to ``LineWidth.SMALLEST`` to match Altium's native new-ellipse default. fill_background: Whether the ellipse is saved with the native solid fill flag enabled.
Returns: A detached ``AltiumSchEllipse`` ready to be added with ``schdoc.add_object(...)``.
Args: center_mils: Elliptical arc center point in mils. radius_mils: Primary ellipse radius in mils. Must be greater than zero. secondary_radius_mils: Secondary ellipse radius in mils. Must be greater than zero. start_angle_degrees: Arc start angle in degrees. end_angle_degrees: Arc end angle in degrees. color: Optional stroke color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. line_width: Stroke thickness enum. Defaults to ``LineWidth.SMALL`` to match Altium's native new-arc default.
Returns: A detached ``AltiumSchEllipticalArc`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached schematic embedded-image object.
Args: bounds_mils: Absolute image rectangle in mils. source_path: Path to the source image file to embed in the document. keep_aspect: Whether the image should preserve its aspect ratio. filename: Optional logical filename stored in the SchDoc storage stream. Defaults to the source file name. orientation: Image rotation in 90-degree increments. draw_border: Whether the image border is rendered. line_width: Border thickness enum when ``draw_border`` is enabled. border_color: Optional image border color helper. ``None`` leaves the native default border color behavior.
Returns: A detached ``AltiumSchImage`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached file-name label owned by a sheet symbol.
Args: text: Child schematic filename text. location_mils: Label anchor location in mils. font: Public font description resolved when the label is added to a document or library. color: Optional text color helper. orientation: Text rotation in 90-degree increments. justification: Text anchor justification relative to ``location_mils``. mirrored: Whether the label is mirrored.
Returns: A detached ``AltiumSchFileName`` ready to be attached through ``sheet_symbol.set_file_name(...)``.
Construct a detached full circular outline using the schematic arc record.
Args: center_mils: Circle center point in mils. radius_mils: Circle radius in mils. Must be greater than zero. color: Optional circle stroke color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. line_width: Circle stroke thickness enum. Defaults to ``LineWidth.SMALL`` to match Altium's native new-arc default.
Returns: A detached ``AltiumSchArc`` configured as a 360-degree circle and ready to be added with ``schdoc.add_object(...)``.
function
make_sch_harness_connector
from altium_monkey import make_sch_harness_connector
Args: bounds_mils: Connector body rectangle in mils. side: Native harness-connector side enum. primary_position_mils: Brace connection position measured along the connector edge in mils. For left/right connectors this is the distance from the top. For top/bottom connectors it is the distance from the left. border_width: Connector border thickness enum. border_color: Optional connector border color helper. fill_color: Optional connector fill color helper.
Returns: A detached ``AltiumSchHarnessConnector`` ready to be added with ``schdoc.add_object(...)``.
Args: name: Entry display name. distance_from_top_mils: Entry offset along the connector edge in mils. font: Public font description resolved when the entry is added to a document or library. border_color: Optional entry border color helper. fill_color: Optional entry fill color helper. text_color: Optional entry text color helper. text_style: Native bus/harness text display style enum. harness_type: Optional native harness-type association string. side: Optional explicit entry side enum. When omitted, the native entry-side default remains in place.
Returns: A detached ``AltiumSchHarnessEntry`` ready to be attached through ``connector.add_entry(...)``.
Construct a detached schematic harness type label.
Args: text: Type-label text. location_mils: Absolute label anchor location in mils. font: Public font description resolved when the label is added to a document or library. color: Optional text color helper. justification: Native text justification enum. orientation: Native text orientation enum.
Returns: A detached ``AltiumSchHarnessType`` ready to be attached through ``connector.set_type_label(...)``.
Args: start_mils: Line start point in mils. end_mils: Line end point in mils. color: Optional line color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. line_width: Line stroke thickness enum. Defaults to ``LineWidth.SMALL`` to match Altium's native new-line default. line_style: Line dash pattern enum. Defaults to ``LineStyle.SOLID`` to match Altium's native new-line default.
Returns: A detached ``AltiumSchLine`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached schematic net label using public-facing parameters.
Args: location_mils: Net-label anchor location in mils. text: Single-line net name text. font: Public font description resolved when the net label is added to a document or library. color: Optional text color helper. ``None`` clears the persisted net-label color field. orientation: Net-label rotation in 90-degree increments. justification: Text anchor justification relative to ``location_mils``. mirrored: Whether the net label is mirrored.
Returns: A detached ``AltiumSchNetLabel`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached generic schematic No ERC directive.
Args: location_mils: Absolute directive origin in mils. symbol: Native No ERC marker style enum. orientation: Native 90-degree orientation enum. Defaults to ``Rotation90.DEG_90`` to match Altium's new-object default. color: Directive color helper. Defaults to Altium's native directive red. is_active: Whether the directive is active. suppress_all: Whether the directive suppresses all supported ERC classes. When ``False``, the two optional suppression payload strings are written through to the record. error_kind_set_to_suppress: Advanced native suppression payload for partial No ERC directives. The empty public default is an explicit factory override; low-level managed objects initialize the full suppressible error-kind set. connection_pairs_to_suppress: Advanced native suppression payload for selective connection-pair suppression. The empty public default is an explicit factory override of the managed all-pairs state.
Returns: A detached ``AltiumSchNoErc`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached schematic note using public-facing note parameters.
Args: bounds_mils: Absolute note rectangle in mils. text: Note text. Ordinary Python newlines are accepted and are encoded to Altium's multiline text format on save. author: Author string stored on the note object. font: Public font description resolved when the note is added to a document or library. border_color: Optional note border color helper. ``None`` clears the persisted border-color field. fill_color: Optional note fill color helper. ``None`` clears the persisted fill-color field. text_color: Optional note text color helper. ``None`` clears the persisted text-color field. alignment: Horizontal text alignment inside the note. word_wrap: Whether note text wraps to the note width. clip_to_rect: Whether note text is clipped to the note bounds. text_margin_mils: Non-negative note text margin in mils. collapsed: Whether the note is saved in the collapsed native note form.
Returns: A detached ``AltiumSchNote`` ready to be added with ``schdoc.add_object(...)``.
Notes: This factory is the shared construction path for detached schematic note objects. The note is later added to a document with ``add_object(...)``, which resolves document-bound resources such as font IDs from ``font``.
function
make_sch_off_sheet_connector
from altium_monkey import make_sch_off_sheet_connector
Construct a detached schematic off-sheet connector.
Args: location_mils: Off-sheet connector anchor location in mils. text: Connector name shown next to the symbol. style: Built-in off-sheet connector direction enum. font: Public font description resolved when the connector is added to a document or library. color: Optional symbol/text color helper. ``None`` clears the persisted off-sheet connector color field. orientation: Connector orientation in 90-degree increments. show_net_name: Whether the connector name is shown.
Returns: A detached ``AltiumSchCrossSheetConnector`` ready to be added with ``schdoc.add_object(...)``.
Notes: This public surface targets Altium's native built-in left/right off-sheet connector styles.
Args: location_mils: Parameter anchor location in mils. name: Parameter name string. text: Parameter value string. font: Public font description resolved when the parameter is added to a document or library. color: Optional text color helper. ``None`` clears the persisted text color field. orientation: Text rotation in 90-degree increments. justification: Text anchor justification relative to ``location_mils``. show_name: Whether the rendered text includes the parameter name. hidden: Whether the parameter is hidden.
Returns: A detached ``AltiumSchParameter`` ready to be added with ``schdoc.add_object(...)``.
Returns: A detached ``AltiumSchParameterSet`` ready to be added with ``schdoc.add_object(...)``.
Notes: Parameter sets can own child parameter records. Add those child parameters separately with ``schdoc.add_object(parameter, owner=set)``. Differential-pair directives are a parameter-set variant: add a hidden child parameter with ``name="DifferentialPair"`` and ``text="True"``.
Create a schematic library pin using public mil-space inputs.
The returned object is an `AltiumSchPin` record. Add it to a symbol with `symbol.add_pin(pin)`. SchLib save resolves pin text font IDs and PinTextData streams; callers do not need to manage font-table indexes.
Args: designator: Pin number shown on the symbol, such as "1" or "A1". location_mils: Pin origin in public schematic mils. name: Functional pin name shown near the pin. orientation: Pin direction as a `Rotation90` value. length_mils: Pin line length in mils. Fractional mil values are preserved in the text record fields when serialized. electrical_type: Electrical behavior as a `PinElectrical` enum value. pin_color: Pin line color as a `ColorValue`. hidden: Hide the complete pin when true. name_visible: Show the pin name when true. designator_visible: Show the pin designator when true. owner_part_id: Multi-part component part id. None uses the record default. owner_part_display_mode: Multi-part display mode id. name_font: Optional `SchFontSpec` for custom pin-name text. name_rotation: Optional pin-name text rotation, horizontal or vertical. name_margin_mils: Optional custom pin-name text margin in mils. name_color: Optional pin-name text color as a `ColorValue`. name_reference_to_component: Position name text relative to the component body instead of the pin. designator_font: Optional `SchFontSpec` for custom designator text. designator_rotation: Optional designator text rotation. designator_margin_mils: Optional custom designator margin in mils. designator_color: Optional designator text color as a `ColorValue`. designator_reference_to_component: Position designator text relative to the component body instead of the pin. description: Optional pin description. swap_id_pin: Pin swap-group identifier. swap_id_part: Part swap-group identifier. swap_id_sequence: Swap sequence identifier. default_value: Optional simulation/default logic value. symbol_inner: IEEE symbol drawn inside the component body. symbol_outer: IEEE symbol drawn outside the component body. symbol_inner_edge: IEEE symbol drawn at the inner edge. symbol_outer_edge: IEEE symbol drawn at the outer edge.
Returns: An unattached `AltiumSchPin` ready for `AltiumSymbol.add_pin(...)`.
Args: points_mils: Ordered polygon vertices in mils. At least three points are required. color: Optional polygon border color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. fill_color: Optional polygon fill color helper. ``None`` omits the persisted area-color field, whose V5 reopen semantic is black. line_width: Polygon border thickness enum. Defaults to ``LineWidth.LARGE`` to match Altium's native new-polygon default. fill_background: Whether the polygon interior is filled. transparent_fill: Whether the filled interior uses the native transparent-fill flag.
Returns: A detached ``AltiumSchPolygon`` ready to be added with ``schdoc.add_object(...)``.
Notes: Native V5 polygon serialization does not carry a line-style field, so the public factory intentionally omits any ``line_style`` parameter.
Args: points_mils: Ordered polyline vertices in mils. At least two points are required. color: Optional polyline color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. line_width: Polyline stroke thickness enum. Defaults to ``LineWidth.SMALL`` to match Altium's native new-polyline default. line_style: Polyline dash pattern enum. start_line_shape: Optional marker drawn on the first vertex. end_line_shape: Optional marker drawn on the last vertex. line_shape_size: Native endpoint marker size state. This reuses the public ``LineWidth`` enum because Altium stores endpoint marker size through the same four-step native size model used for schematic line widths: ``SMALLEST``, ``SMALL``, ``MEDIUM``, and ``LARGE``.
Returns: A detached ``AltiumSchPolyline`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached schematic hierarchical port using public-facing units.
Args: location_mils: Port anchor location in mils. name: Port name shown on the port body. width_mils: Port body length in mils. Port width is stored natively in 10-mil units and is rounded to the nearest native unit. height_mils: Port body thickness in mils. Port height is stored natively in 10-mil units and is rounded to the nearest native unit. io_type: Port I/O direction enum. style: Native port style enum. font: Public font description resolved when the port is added to a document or library. border_color: Optional border color helper. ``None`` clears the persisted border-color field. fill_color: Optional fill color helper. ``None`` clears the persisted fill-color field. text_color: Optional text color helper. ``None`` clears the persisted text-color field. alignment: Port text alignment enum. border_width: Port border thickness enum. ``LineWidth.SMALLEST`` matches the native default field-omission behavior. auto_size: Whether Altium may auto-size the port. show_net_name: Whether the port name is shown. harness_type: Optional harness type string. Ordinary hierarchical ports should leave this empty.
Returns: A detached ``AltiumSchPort`` ready to be added with ``schdoc.add_object(...)``.
Notes: This factory targets ordinary named ports. Cross-reference display mode and custom object-definition-backed port graphics are intentionally out of scope for this public surface.
Construct a detached schematic power port using built-in Altium styles.
Args: location_mils: Power-port anchor location in mils. text: Net name displayed and connected by the power port. style: Built-in power-port style enum. font: Public font description resolved when the power port is added to a document or library. color: Optional symbol/text color helper. ``None`` clears the persisted power-port color field. orientation: Power-port orientation in 90-degree increments. show_net_name: Optional explicit net-name visibility override. When ``None``, the native style-based default is used, which hides names for ground-style symbols.
Returns: A detached ``AltiumSchPowerPort`` ready to be added with ``schdoc.add_object(...)``.
Notes: This public factory currently targets ordinary built-in power-port symbols such as bar, arrow, wave, and ground variants. Advanced custom power-port graphics backed by ``ObjectDefinitionId`` are intentionally out of scope for this surface.
Args: bounds_mils: Absolute rectangle bounds in mils. color: Optional border color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. fill_color: Optional fill color helper. ``None`` omits the persisted area-color field, whose V5 reopen semantic is black. line_width: Rectangle border thickness enum. Defaults to ``LineWidth.SMALLEST`` to match Altium's native new-rectangle default. line_style: Rectangle border dash pattern enum. fill_background: Whether the rectangle interior is filled. transparent_fill: Whether the filled interior uses the native transparent-fill flag.
Returns: A detached ``AltiumSchRectangle`` ready to be added with ``schdoc.add_object(...)``.
function
make_sch_rounded_rectangle
from altium_monkey import make_sch_rounded_rectangle
Args: bounds_mils: Absolute rounded-rectangle bounds in mils. corner_x_radius_mils: Rounded-corner X radius in mils. Must be non-negative. corner_y_radius_mils: Rounded-corner Y radius in mils. Must be non-negative. color: Optional border color helper. ``None`` omits the persisted color field, whose V5 reopen semantic is black. fill_color: Optional fill color helper. ``None`` omits the persisted area-color field, whose V5 reopen semantic is black. line_width: Rounded-rectangle border thickness enum. Defaults to ``LineWidth.SMALLEST`` to match Altium's native new-object default. fill_background: Whether the rounded rectangle interior is filled.
Returns: A detached ``AltiumSchRoundedRectangle`` ready to be added with ``schdoc.add_object(...)``.
Notes: Native rounded rectangles do not expose the plain rectangle ``line_style`` or ``transparent`` surface in the V5 schematic record format, so those options are intentionally omitted here.
Construct a detached sheet entry owned by a sheet symbol.
Args: name: Entry display name. side: Native sheet-entry side enum. io_type: Native sheet-entry I/O direction enum. distance_from_top_mils: Entry offset from the owning symbol edge in mils. Altium sheet entries use a 100-mil placement grid. font: Public font description resolved when the entry is added to a document or library. border_color: Optional entry border color helper. fill_color: Optional entry fill color helper. text_color: Optional entry text color helper. arrow_kind: Native sheet-entry arrow-shape enum. text_style: Shared native entry-label display style enum. harness_type: Optional native harness-type association string.
Returns: A detached ``AltiumSchSheetEntry`` ready to be attached through ``sheet_symbol.add_entry(...)``.
Construct a detached sheet-name label owned by a sheet symbol.
Args: text: Sheet-name text shown above the symbol body. location_mils: Label anchor location in mils. font: Public font description resolved when the label is added to a document or library. color: Optional text color helper. orientation: Text rotation in 90-degree increments. justification: Text anchor justification relative to ``location_mils``. mirrored: Whether the label is mirrored.
Returns: A detached ``AltiumSchSheetName`` ready to be attached through ``sheet_symbol.set_sheet_name(...)``.
Args: bounds_mils: Sheet-symbol body rectangle in mils. border_width: Symbol border thickness enum. border_color: Optional border color helper. ``None`` leaves the native border color behavior. fill_color: Optional interior fill color helper. The default matches Altium's ordinary new-sheet-symbol fill color. fill_background: Whether the sheet-symbol interior is filled. symbol_type: Native sheet-symbol type enum. Use ``SchSheetSymbolType.DEVICE_SHEET`` for the rounded-corner variant. show_hidden_fields: Whether the symbol is saved with hidden child fields visible. design_item_id: Optional design-item identifier string. source_library_name: Optional source-library name string. vault_guid: Optional vault GUID string. item_guid: Optional item GUID string. revision_guid: Optional revision GUID string. revision_name: Optional revision name string.
Returns: A detached ``AltiumSchSheetSymbol`` with the managed default sheet-name and file-name child pair, ready to own entries before it is added with ``schdoc.add_object(...)``.
Notes: Attach ``make_sch_sheet_entry(...)`` records with ``sheet_symbol.add_entry(...)``. Calls to ``set_sheet_name(...)`` and ``set_file_name(...)`` replace the managed default child labels.
Construct a detached schematic text frame using public-facing parameters.
Args: bounds_mils: Absolute text-frame rectangle in mils. text: Text content to place in the frame. Newlines are preserved. font: Public font description resolved when the frame is added to a document or library. border_color: Optional border color helper. ``None`` omits the persisted border color, whose V5 reopen semantic is black. fill_color: Optional background fill color helper. ``None`` omits the persisted fill color, whose V5 reopen semantic is black. text_color: Optional text color helper. ``None`` omits the persisted text color, whose V5 reopen semantic is black. alignment: Horizontal text alignment inside the frame. line_width: Border thickness enum for the text-frame outline. word_wrap: Whether text wraps to the frame width. clip_to_rect: Whether text is clipped to the frame bounds. text_margin_mils: Non-negative text margin in mils. show_border: Whether the frame outline is drawn. fill_background: Whether the background is filled with ``fill_color``.
Returns: A detached ``AltiumSchTextFrame`` ready to be added with ``schdoc.add_object(...)``.
Construct a detached schematic text string using public-facing parameters.
Args: location_mils: Text anchor location in mils. text: Single-line text content. Use a text frame or note for multiline text. font: Public font description resolved when the text string is added to a document or library. color: Optional text color helper. ``None`` clears the persisted text color field. orientation: Text rotation in 90-degree increments. justification: Text anchor justification relative to ``location_mils``. mirrored: Whether the text string is mirrored. url: Optional URL string stored on the text string object.
Returns: A detached ``AltiumSchLabel`` ready to be added with ``schdoc.add_object(...)``.
Args: points_mils: Ordered wire path points in mils. At least two points are required. color: Optional wire color helper. ``None`` clears the persisted wire color field. line_width: Wire thickness enum. Defaults to ``LineWidth.SMALL`` to match Altium's native new-wire default.
Returns: A detached ``AltiumSchWire`` ready to be added with ``schdoc.add_object(...)``.
function
merge_directory
from altium_monkey.altium_schlib_merger import merge_directory
Altium convention: Location.X <= Corner.X and Location.Y <= Corner.Y After un-mirror transformation, coordinates may be swapped.
Modifies rect in-place.
Args: rect: Object with location and corner CoordPoint attributes
enum
OffSheetConnectorStyle
from altium_monkey importOffSheetConnectorStyle
enum OffSheetConnectorStyle
Off-sheet connector symbol styles.
These match Altium's stored values for cross-sheet connectors.
Members (2)
Kind
Signature
Summary
member
LEFT= 0
member
RIGHT= 1
enum
ParameterSetStyle
from altium_monkey importParameterSetStyle
enum ParameterSetStyle
Parameter set display style.
Controls how a parameter set is displayed on the schematic.
Native Altium schematic parameter sets only expose two styles: large and tiny. There is no native medium style.
Members (2)
Kind
Signature
Summary
member
LARGE= 0
member
TINY= 1
enum
PinElectrical
from altium_monkey importPinElectrical
enum PinElectrical
Pin electrical types.
Defines the electrical characteristics of a pin for ERC checking.
Members (8)
Kind
Signature
Summary
member
INPUT= 0
member
IO= 1
member
OUTPUT= 2
member
OPEN_COLLECTOR= 3
member
PASSIVE= 4
member
HIZ= 5
member
OPEN_EMITTER= 6
member
POWER= 7
enum
PinItemMode
from altium_monkey importPinItemMode
enum PinItemMode
Pin text item mode (default vs custom).
Controls whether name/designator use default or custom font/position.
Members (2)
Kind
Signature
Summary
member
DEFAULT= 0
member
CUSTOM= 1
enum
PinOrientation
from altium_monkey importPinOrientation
enum PinOrientation
Pin orientation/direction.
Used for schematic pin placement indicating which direction the pin points. Same values as Rotation90 but with directional naming for pin contexts.
Members (4)
Kind
Signature
Summary
member
RIGHT= 0
member
UP= 1
member
LEFT= 2
member
DOWN= 3
enum
PinTextAnchor
from altium_monkey importPinTextAnchor
enum PinTextAnchor
Pin text rotation anchor point.
Determines reference point for text rotation calculation.
Members (2)
Kind
Signature
Summary
member
PIN= 0
member
COMPONENT= 1
enum
PinTextOrientation
from altium_monkey importPinTextOrientation
enum PinTextOrientation
Pin text orientation in degree values.
Used by PinTextData helper surfaces that expose the stream orientation as concrete degrees rather than quarter-turn indices.
Members (4)
Kind
Signature
Summary
member
DEG_0= 0
member
DEG_90= 90
member
DEG_180= 180
member
DEG_270= 270
enum
PinTextRotation
from altium_monkey importPinTextRotation
enum PinTextRotation
Pin text rotation values.
Only 0 and 90 degrees are valid for pin name/designator text. Used in AltiumSchPin constructor for name_rotation and designator_rotation.
Note: This uses actual degree values (0, 90), not indices like Rotation90. The PinTextData stream stores rotation as a flag bit, not this value directly.
Members (2)
Kind
Signature
Summary
member
HORIZONTAL= 0
member
VERTICAL= 90
function
portable_font_replacements
from altium_monkey import portable_font_replacements
Preflight all scalar edits, then change only their Name/Text properties.
Does not save files, infer net-level intent, update PCB data or resize ports. Recompile/reopen at the caller's staging boundary to verify connectivity.
function
render_schematic_harness_file
from altium_monkey.altium_schematic_refactor import render_schematic_harness_file
Render generated connector definitions; None means no sibling storage.
Uses admitted per-document source, raw merged entries, CRLF and the managed Windows-1252 best-fit codec. Type rows use deterministic ordinal name order; native culture-dependent presentation order is not a byte-parity promise. Does not read/write sidecars or include external locked/custom definitions.
enum
Rotation90
from altium_monkey importRotation90
enum Rotation90
Rotation in 90-degree increments.
Used for pin orientation and text rotation.
Members (4)
Kind
Signature
Summary
member
DEG_0= 0
member
DEG_90= 1
member
DEG_180= 2
member
DEG_270= 3
constant
SCHDOC_INTEROP_SCHEMA
from altium_monkey importSCHDOC_INTEROP_SCHEMA
SCHDOC_INTEROP_SCHEMA: str
enum
SchHarnessConnectorSide
from altium_monkey importSchHarnessConnectorSide
enum SchHarnessConnectorSide
Harness connector side placement.
Members (4)
Kind
Signature
Summary
member
LEFT= 0
member
RIGHT= 1
member
TOP= 2
member
BOTTOM= 3
enum
SchHorizontalAlign
from altium_monkey importSchHorizontalAlign
enum SchHorizontalAlign
Horizontal alignment for schematic note and text-frame content.
These values match Altium's horizontal alignment storage for schematic text frames and notes.
Members (3)
Kind
Signature
Summary
member
CENTER= 0
member
LEFT= 1
member
RIGHT= 2
constant
SCHLIB_INTEROP_SCHEMA
from altium_monkey importSCHLIB_INTEROP_SCHEMA
SCHLIB_INTEROP_SCHEMA: str
enum
SchRecordType
from altium_monkey.altium_record_types importSchRecordType
enum SchRecordType
Record type IDs for Altium SchLib/SchDoc files.
Same record types are used in both SchLib (symbol libraries) and SchDoc (schematic documents), though some types are more common in one vs the other.
Members (64)
Kind
Signature
Summary
member
HEADER= 0
member
COMPONENT= 1
member
PIN= 2
member
IEEE_SYMBOL= 3
member
LABEL= 4
member
BEZIER= 5
member
POLYLINE= 6
member
POLYGON= 7
member
ELLIPSE= 8
member
PIECHART= 9
member
ROUND_RECTANGLE= 10
member
ELLIPTICAL_ARC= 11
member
ARC= 12
member
LINE= 13
member
RECTANGLE= 14
member
SHEET_SYMBOL= 15
member
SHEET_ENTRY= 16
member
POWER_PORT= 17
member
PORT= 18
member
NO_ERC= 22
member
NET_LABEL= 25
member
BUS= 26
member
WIRE= 27
member
TEXT_FRAME= 28
member
JUNCTION= 29
member
IMAGE= 30
member
SHEET= 31
member
SHEET_NAME= 32
member
FILE_NAME= 33
member
DESIGNATOR= 34
member
BUS_ENTRY= 37
member
TEMPLATE= 39
member
PARAMETER= 41
member
PARAMETER_SET= 43
member
IMPLEMENTATION_LIST= 44
member
IMPLEMENTATION= 45
member
MAP_DEFINER_LIST= 46
member
MAP_DEFINER= 47
member
IMPL_PARAMS= 48
member
HARNESS_COMPONENT= 106
member
HARNESS_SPLICE= 108
member
HARNESS_LAYOUT_LABEL= 109
member
HARNESS_LAYOUT_CONNECTION_POINT= 110
member
HARNESS_BUNDLE= 111
member
LINE_VIEW= 126
member
HARNESS_LAYOUT_COVERING= 128
member
REUSE_BLOCK_IMPLEMENTATION_INFO= 138
member
HARNESS_CAVITY= 140
member
HARNESS_CAVITY_COMPONENT= 141
member
NOTE= 209
member
COMPILE_MASK= 211
member
HARNESS_CONNECTOR= 215
member
HARNESS_ENTRY= 216
member
HARNESS_TYPE= 217
member
SIGNAL_HARNESS= 218
member
HIGH_LEVEL_CODE_SYMBOL= 220
member
HIGH_LEVEL_CODE_ENTRY= 221
member
HIGH_LEVEL_CODE_NAME= 222
member
HIGH_LEVEL_CODE_FILE_NAME= 223
member
BLANKET= 225
member
HYPERLINK= 226
member
RICH_TEXT_DOCUMENT= 240
member
RTF_LINK= 241
member
OBJECT_DEFINITION= 129
enum
SchSheetEntryArrowKind
from altium_monkey importSchSheetEntryArrowKind
enum SchSheetEntryArrowKind
Arrow shape for sheet entries.
Members (4)
Kind
Signature
Summary
member
BLOCK_TRIANGLE= 0
member
TRIANGLE= 1
member
ARROW= 2
member
ARROW_TAIL= 3
enum
SchSheetEntryIOType
from altium_monkey importSchSheetEntryIOType
enum SchSheetEntryIOType
I/O direction for sheet entries.
Members (4)
Kind
Signature
Summary
member
UNSPECIFIED= 0
member
OUTPUT= 1
member
INPUT= 2
member
BIDIRECTIONAL= 3
enum
SchSheetSymbolType
from altium_monkey importSchSheetSymbolType
enum SchSheetSymbolType
Sheet symbol type (affects visual appearance).
Members (3)
Kind
Signature
Summary
member
NORMAL= 0
member
DEVICE_SHEET= 1
member
DESIGN_ITEM= 2
enum
SheetEntrySide
from altium_monkey importSheetEntrySide
enum SheetEntrySide
Sheet entry side placement.
Members (4)
Kind
Signature
Summary
member
LEFT= 0
member
RIGHT= 1
member
TOP= 2
member
BOTTOM= 3
enum
SheetStyle
from altium_monkey importSheetStyle
enum SheetStyle
Sheet size styles used by schematic documents.
Members (18)
Kind
Signature
Summary
member
A4= 0
member
A3= 1
member
A2= 2
member
A1= 3
member
A0= 4
member
A= 5
member
B= 6
member
C= 7
member
D= 8
member
E= 9
member
LETTER= 10
member
LEGAL= 11
member
TABLOID= 12
member
ORCAD_A= 13
member
ORCAD_B= 14
member
ORCAD_C= 15
member
ORCAD_D= 16
member
ORCAD_E= 17
enum
StdLogicState
from altium_monkey importStdLogicState
enum StdLogicState
Standard logic state for formal type specification.
Used for simulation and formal verification.
Members (9)
Kind
Signature
Summary
member
UNINITIALIZED= 0
member
FORCING_UNKNOWN= 1
member
FORCING_0= 2
member
FORCING_1= 3
member
HIZ= 4
member
WEAK_UNKNOWN= 5
member
WEAK_0= 6
member
WEAK_1= 7
member
DONT_CARE= 8
enum
SymbolLineWidth
from altium_monkey importSymbolLineWidth
enum SymbolLineWidth
Symbol/line width sizes.
Used for pin symbol line thickness.
Members (4)
Kind
Signature
Summary
member
ZERO= 0
member
SMALL= 1
member
MEDIUM= 2
member
LARGE= 3
enum
TextJustification
from altium_monkey importTextJustification
enum TextJustification
Text horizontal justification.
Controls horizontal alignment of text elements.
Members (9)
Kind
Signature
Summary
member
BOTTOM_LEFT= 0
member
BOTTOM_CENTER= 1
member
BOTTOM_RIGHT= 2
member
CENTER_LEFT= 3
member
CENTER_CENTER= 4
member
CENTER_RIGHT= 5
member
TOP_LEFT= 6
member
TOP_CENTER= 7
member
TOP_RIGHT= 8
enum
TextOrientation
from altium_monkey importTextOrientation
enum TextOrientation
Text orientation in 90-degree increments.
Used for Label, Parameter, Designator, PowerPort, TextFrame orientation. Same values as Rotation90 but with DEGREES_* naming for text contexts.
Members (4)
Kind
Signature
Summary
member
DEGREES_0= 0
member
DEGREES_90= 1
member
DEGREES_180= 2
member
DEGREES_270= 3
function
to_schematic_space
from altium_monkey.altium_symbol_transform import to_schematic_space
Transform an OOP object from symbol-space to schematic-space.
Returns a deep copy with transformed coordinates. Works with any object that has location/corner/vertices attributes (AltiumSchPin, AltiumSchRectangle, AltiumSchLine, AltiumSchPolyline, etc.).
This is the inverse of to_symbol_space() and is used when inserting library symbols into schematics.
Args: obj: OOP record object with coordinate attributes component: AltiumSchComponent with location, orientation, is_mirrored regenerate_id: If True, generate a new unique_id for the clone (default True)
function
to_symbol_space
from altium_monkey.altium_symbol_transform import to_symbol_space
Transform an OOP object from schematic-space to symbol-space.
Returns a deep copy with transformed coordinates. Works with any object that has location/corner/vertices attributes (AltiumSchPin, AltiumSchRectangle, AltiumSchLine, AltiumSchPolyline, etc.).
Args: obj: OOP record object with coordinate attributes component: AltiumSchComponent with location, orientation, is_mirrored
Returns: Deep copy of obj with coordinates transformed to symbol-space
function
trace_schematic_source_fields
from altium_monkey.altium_schematic_refactor import trace_schematic_source_fields
Recompile and expose checked flat-net/source associations as rich values.
IDs are scoped to this Design and stable under naming-only edits when source identity is admitted. This is not a C0 wire export or a full hierarchy facade. Unsupported identities, source associations and terminal-free partitions are reported as gaps rather than fabricated memberships.
function
transform_pin_orientation
from altium_monkey.altium_symbol_transform import transform_pin_orientation
Transform a point from symbol-space to schematic-space.
This is the inverse of transform_point_to_symbol_space().
Args: x_mils: Point X coordinate in mils (symbol space) y_mils: Point Y coordinate in mils (symbol space) comp_x_mils: Component location X in mils comp_y_mils: Component location Y in mils orientation: Component rotation (0=0deg, 1=90deg, 2=180deg, 3=270deg CCW) is_mirrored: Component is horizontally mirrored (Y-axis flip)
Returns: Tuple (x, y) in schematic-space mils
function
transform_point_to_symbol_space
from altium_monkey.altium_symbol_transform import transform_point_to_symbol_space
Transform a point from schematic-space to symbol-space.
Args: x_mils: Point X coordinate in mils (schematic space) y_mils: Point Y coordinate in mils (schematic space) comp_x_mils: Component location X in mils comp_y_mils: Component location Y in mils orientation: Component rotation (0=0deg, 1=90deg, 2=180deg, 3=270deg CCW) is_mirrored: Component is horizontally mirrored (Y-axis flip)
Returns: Tuple (x, y) in symbol-space mils
Note: Altium applies transformations in order: Rotate -> Mirror To reverse: Translate -> Un-mirror -> Un-rotate
function
validate_schdoc_interop_json
from altium_monkey import validate_schdoc_interop_json