On This Page (28) Draftsman & Integrated Libraries Experimental Draftsman documents and IntLib extraction/authoring.
All kinds Classes Enums Functions Constants 28 / 28 shown
class
AltiumDraftsmanDocument from altium_monkey import AltiumDraftsmanDocument
class AltiumDraftsmanDocument ( root: 'etree._Element' , *, source_path: 'str | Path | None' = None , source_compression: 'DraftsmanSourceCompression' = 'raw' ) -> 'None'
XML-backed Draftsman document with conservative load and save support.
Members (33) Kind Signature Summary method add_page(self, *, copy_from: 'AltiumDraftsmanPage | None' = None, clear_items: 'bool' = True) -> 'AltiumDraftsmanPage'Append a page cloned from existing sheet setup and return it. classmethod blank(cls, profile: 'str' = 'ad25', *, source_document_name: 'str | Path | None' = None) -> 'Self'Create a blank Draftsman document from packaged defaults. property document_options -> 'AltiumDraftsmanDocumentOptions'Return the XML-backed document options wrapper. method find_font_style(self, family_name: 'str', size: 'float', *, decorations: 'DraftsmanFontDecoration' = <DraftsmanFontDecoration.NONE: 0>) -> 'DraftsmanFontStyle | None'Return the first matching font style from the document pool. method font_style_by_id(self, style_id: 'int') -> 'DraftsmanFontStyle | None'Return the font style with the requested id, if present. property font_styles -> 'ObjectCollection'Return document-level font styles. property format_version -> 'int | None'Return the Draftsman format version when the root declares one. classmethod from_bytes(cls, data: 'bytes', *, source_path: 'str | Path | None' = None) -> 'Self'Load a Draftsman document from raw file bytes. classmethod from_file(cls, path: 'str | Path') -> 'Self'Load a Draftsman file from disk. classmethod from_payload(cls, payload: 'DraftsmanContainerPayload', *, source_path: 'str | Path | None' = None) -> 'Self'Load a Draftsman document from a decoded container payload. classmethod from_template(cls, path: 'str | Path', *, source_document_name: 'str | Path | None' = None) -> 'Self'Load a Draftsman template file as an editable document. classmethod from_xml_bytes(cls, xml_bytes: 'bytes', *, source_path: 'str | Path | None' = None, source_compression: 'DraftsmanSourceCompression' = 'raw') -> 'Self'Load a Draftsman document from decoded XML bytes. method get_or_create_font_style(self, family_name: 'str', size: 'float', *, bold: 'bool' = False, italic: 'bool' = False, underline: 'bool' = False, strikeout: 'bool' = False, decorations: 'DraftsmanFontDecoration | None' = None) -> 'DraftsmanFontStyle'Return a matching font style, adding one when necessary. method item_by_id(self, item_id: 'int') -> 'AltiumDraftsmanItem | None'Return the first page item with the requested id. property items -> 'ObjectCollection'Return a read-only collection of all page item wrappers. property max_page_or_item_id -> 'int'Return the highest id found on pages and page items. method move_page(self, id_or_page: 'int | AltiumDraftsmanPage', index: 'int') -> 'None'Move a page to a new zero-based position. property next_page_or_item_id -> 'int'Return the next id after all known page and item ids. method note_by_id(self, note_id: 'int') -> 'AltiumDraftsmanNote | None'Return the first note item with the requested id. property notes -> 'ObjectCollection'Return a read-only collection of note items in the document. method page_by_id(self, page_id: 'int') -> 'AltiumDraftsmanPage | None'Return the first page with the requested id. property pages -> 'ObjectCollection'Return a read-only collection of page wrappers. property pictures -> 'ObjectCollection'Return a read-only collection of picture items in the document. method remove_page(self, id_or_page: 'int | AltiumDraftsmanPage') -> 'bool'Remove a page by id or wrapper and report whether it was found. property root -> 'etree._Element'Return the live XML root element. property root_tag -> 'str'Return the root XML element local name. method save(self, path: 'str | Path', *, compression: 'DraftsmanWriteCompression' = 'preserve', pretty_print: 'bool' = False) -> 'None'Write the document to disk. method set_source_document_name(self, source_document_name: 'str | Path') -> 'None'Set the linked board or project filename stored in the document. property source_compression -> 'DraftsmanSourceCompression'Return the original container encoding for this document. property source_document_name -> 'str'Return the linked board or project filename stored in the document. property source_path -> 'Path | None'Return the path this document was loaded from, if known. property texts -> 'ObjectCollection'Return a read-only collection of text items in the document. method to_xml_bytes(self, *, pretty_print: 'bool' = False) -> 'bytes'Serialize the live XML tree to UTF-8 bytes.
class
AltiumDraftsmanDocumentOptions from altium_monkey import AltiumDraftsmanDocumentOptions
class AltiumDraftsmanDocumentOptions ( element: 'etree._Element' , document: "'AltiumDraftsmanDocument'" ) -> 'None'
XML-backed wrapper for Draftsman document-level drawing options.
Members (10) Kind Signature Summary property border_color -> 'DraftsmanColor | None'Return the sheet border color. property element -> 'etree._Element'Return the live XML element for the options block. property font_style -> 'DraftsmanFontStyle | None'Return the document default font style when it is in the style pool. property font_style_id -> 'int | None'Return the document default font style id. property grid_color -> 'DraftsmanColor | None'Return the Draftsman grid color. property grid_size_mm -> 'float | None'Return the Draftsman grid size in millimeters. property grid_visible -> 'bool | None'Return whether the Draftsman grid is visible. property non_fitted_font_style_id -> 'int | None'Return the non-fitted component font style id. method set_font_style(self, font_style: 'DraftsmanFontStyle | int') -> 'None'Set the document default font style by style object or id. property sheet_color -> 'DraftsmanColor | None'Return the page background color.
class
AltiumDraftsmanItem from altium_monkey import AltiumDraftsmanItem
class AltiumDraftsmanItem ( element: 'etree._Element' , page: "'AltiumDraftsmanPage'" ) -> 'None'
Generic XML-backed wrapper for one Draftsman page item.
Members (7) Kind Signature Summary property element -> 'etree._Element'Return the live XML element for this item. property id -> 'int | None'Return the item id when present. property item_type -> 'str'Return the Draftsman item type label. property page -> "'AltiumDraftsmanPage'"Return the page that owns this item. property rect -> 'DraftsmanRect | None'Return this item's rectangle in page millimeters when present. property rotation_degrees -> 'float | None'Return this item's current rotation in degrees when present. property title -> 'str | None'Return the item title field when present.
class
AltiumDraftsmanNote from altium_monkey import AltiumDraftsmanNote
class AltiumDraftsmanNote ( element: 'etree._Element' , page: "'AltiumDraftsmanPage'" ) -> 'None'
Typed XML-backed wrapper for one Draftsman note item.
Members (20) Kind Signature Summary method add_element(self, text: 'str', *, element_id: 'str | None' = None, template_element_id: 'str | None' = None, border_style: 'DraftsmanNoteBorderStyle | None' = None) -> 'AltiumDraftsmanNoteElement'Append a note element and return its live wrapper. method element_by_id(self, element_id: 'str') -> 'AltiumDraftsmanNoteElement | None'Return the first note element with the requested durable id. property element_count -> 'int'Return the number of note elements. property element_font_style -> 'DraftsmanFontStyle | None'Return the note body font style when it is in the style pool. property element_font_style_id -> 'int | None'Return the note body font style id. property element_text_color -> 'DraftsmanColor | None'Return the note body text color. property elements -> 'ObjectCollection'Return a read-only collection of note elements. method move_element(self, element_id: 'str', index: 'int') -> 'None'Move a note element to a new zero-based position. property rect -> 'DraftsmanRect | None'Return the note placement as a Draftsman rectangle. method remove_element(self, element_id: 'str') -> 'bool'Remove a note element by durable id and report whether it was found. method set_element_font_style(self, font_style: 'DraftsmanFontStyle | int') -> 'None'Set the note body font style and make the explicit style active. method set_title_font_style(self, font_style: 'DraftsmanFontStyle | int') -> 'None'Set the note title font style and make the explicit style active. property start_point -> 'DraftsmanPoint | None'Return the note start point in page millimeters. property title_font_style -> 'DraftsmanFontStyle | None'Return the note title font style when it is in the style pool. property title_font_style_id -> 'int | None'Return the note title font style id. property title_text_color -> 'DraftsmanColor | None'Return the note title text color. property title_visible -> 'bool | None'Return whether the note title is visible when the field is present. property use_document_font_for_elements -> 'bool | None'Return whether note body rows use the document font style. property use_document_font_for_title -> 'bool | None'Return whether the note title uses the document font style. property width_mm -> 'float | None'Return the note width in millimeters.
class
AltiumDraftsmanNoteElement from altium_monkey import AltiumDraftsmanNoteElement
class AltiumDraftsmanNoteElement ( element: 'etree._Element' , note: "'AltiumDraftsmanNote'" ) -> 'None'
XML-backed wrapper for one Draftsman note element.
Members (10) Kind Signature Summary property border_style -> 'str | None'Return the legacy border style label when present. property border_style_kind -> 'DraftsmanNoteBorderStyle'Return the effective note border style enum. property border_style_v2 -> 'int | None'Return the current numeric border style value when present. property element -> 'etree._Element'Return the live XML element for this note element. property first_line_indent_mm -> 'float | None'Return the first-line indent in millimeters when present. property id -> 'str | None'Return the durable note-element id when present. property note -> "'AltiumDraftsmanNote'"Return the note that owns this element. property postfix -> 'str | None'Return the note numbering postfix field when present. method set_border_style(self, style: 'DraftsmanNoteBorderStyle') -> 'None'Set the note row border style using Altium's current V2 enum. property text -> 'str | None'Return the displayed note text.
class
AltiumDraftsmanPage from altium_monkey import AltiumDraftsmanPage
class AltiumDraftsmanPage ( element: 'etree._Element' , document: "'AltiumDraftsmanDocument'" ) -> 'None'
XML-backed wrapper for one Draftsman page.
Geometry helpers expose millimeters. Draftsman page coordinates use a lower-left origin: X increases rightward and Y increases upward.
Members (21) Kind Signature Summary method add_note(self, *, title: 'str | None' = None, rect: 'DraftsmanRect | None' = None, x_mm: 'float | None' = None, y_mm: 'float | None' = None, width_mm: 'float | None' = None, bullets: 'list[str] | tuple[str, ...]' = (), element_font_style: 'DraftsmanFontStyle | int | None' = None, title_font_style: 'DraftsmanFontStyle | int | None' = None, text_color: 'DraftsmanColor | None' = None, title_visible: 'bool' = True, use_document_font_for_elements: 'bool | None' = None, use_document_font_for_title: 'bool | None' = None, bullet_border_style: 'DraftsmanNoteBorderStyle' = <DraftsmanNoteBorderStyle.NONE: 0>) -> 'AltiumDraftsmanNote'Append a simple Draftsman note item to this page. method add_picture(self, *, source_path: 'str | Path', rect: 'DraftsmanRect', maintain_aspect_ratio: 'bool' = True, rotation_degrees: 'float' = 0.0) -> 'AltiumDraftsmanPicture'Append a Draftsman picture item with embedded image bytes. method add_text(self, *, text: 'str', rect: 'DraftsmanRect', font_style: 'DraftsmanFontStyle | int | None' = None, color: 'DraftsmanColor | None' = None, horizontal_alignment: 'DraftsmanHorizontalAlignment | str' = <DraftsmanHorizontalAlignment.LEFT: 'Left'>, vertical_alignment: 'DraftsmanVerticalAlignment | str' = <DraftsmanVerticalAlignment.TOP: 'Top'>, clip_to_bounds: 'bool' = True, use_document_font: 'bool | None' = None, rotation_degrees: 'float' = 0.0, fill_style_id: 'int' = 0) -> 'AltiumDraftsmanText'Append a Draftsman text item to this page. method apply_standard_sheet_size(self, value: 'DraftsmanStandardSheetSize') -> 'None'Set this page to one of Altium's standard sheet sizes. property document -> "'AltiumDraftsmanDocument'"Return the document that owns this page. property element -> 'etree._Element'Return the live XML element for this page. property id -> 'int | None'Return the page id when present. method item_by_id(self, item_id: 'int') -> 'AltiumDraftsmanItem | None'Return the first page item with the requested id. property item_count -> 'int'Return the number of page items. property items -> 'ObjectCollection'Return a read-only collection of page item wrappers. method items_by_type(self, item_type: 'str') -> 'ObjectCollection'Return a read-only collection of page items with a raw item type. property margin -> 'DraftsmanMargin | None'Return the page margins in millimeters. method note_by_title(self, title: 'str', *, case_sensitive: 'bool' = False) -> 'AltiumDraftsmanNote | None'Return the first page note with the requested title. property notes -> 'ObjectCollection'Return a read-only collection of note items on this page. method point_from_top_left(self, *, left_mm: 'float', top_mm: 'float') -> 'DraftsmanPoint'Return a page point offset from the visual top-left corner. method rect_centered(self, *, width_mm: 'float', height_mm: 'float') -> 'DraftsmanRect'Return a rectangle centered on the page. property sheet_sizing_mode -> 'str | None'Return the raw Draftsman sheet sizing mode label. property show_zones -> 'bool | None'Return whether page zones are visible. property size -> 'DraftsmanSize | None'Return the page size in millimeters. property standard_sheet_size -> 'DraftsmanStandardSheetSize | None'Return the standard sheet-size enum when the name is recognized. property standard_size_name -> 'str | None'Return the standard sheet size label, such as `A4`.
class
AltiumDraftsmanPicture from altium_monkey import AltiumDraftsmanPicture
class AltiumDraftsmanPicture ( element: 'etree._Element' , page: "'AltiumDraftsmanPage'" ) -> 'None'
Typed XML-backed wrapper for one Draftsman picture item.
Members (3) Kind Signature Summary property image_bytes -> 'bytes'Return the embedded image bytes. property maintain_aspect_ratio -> 'bool | None'Return whether the picture keeps the source image aspect ratio. method set_image_bytes(self, data: 'bytes') -> 'None'Replace the embedded image bytes.
class
AltiumDraftsmanText from altium_monkey import AltiumDraftsmanText
class AltiumDraftsmanText ( element: 'etree._Element' , page: "'AltiumDraftsmanPage'" ) -> 'None'
Typed XML-backed wrapper for one Draftsman text item.
Members (10) Kind Signature Summary property clip_to_bounds -> 'bool | None'Return whether rendering clips text to `rect`. property color -> 'DraftsmanColor | None'Return the text color. property fill_style_id -> 'int | None'Return the text fill-style id. property font_style -> 'DraftsmanFontStyle | None'Return the text font style when it is in the style pool. property font_style_id -> 'int | None'Return the text font-style id. property horizontal_alignment -> 'DraftsmanHorizontalAlignment | None'Return the horizontal alignment enum when recognized. method set_font_style(self, font_style: 'DraftsmanFontStyle | int') -> 'None'Set the text font style and make the explicit style active. property text -> 'str | None'Return the displayed text expression. property use_document_font -> 'bool | None'Return whether this text follows the document default font. property vertical_alignment -> 'DraftsmanVerticalAlignment | None'Return the vertical alignment enum when recognized.
class
AltiumIntLib from altium_monkey import AltiumIntLib
class AltiumIntLib ( filepath: 'str | Path' ) -> 'None'
Read, create, and extract Altium `.IntLib` files.
Creation packages ordered, already-prepared SchLib and PcbLib sources. Source-library merging and application catalog policy remain separate operations.
Members (9) Kind Signature Summary method close(self) -> 'None'Release the parsed OLE container state. property component_parse_error -> 'str | None'Cross-reference parse error, if component metadata could not be read. property components -> 'tuple[IntLibComponent, ...]'Component records parsed from `LibCrossRef.Txt`. classmethod create_from_libraries(cls, output_path: 'str | Path', *, schlib_paths: 'Sequence[str | Path]', pcblib_paths: 'Sequence[str | Path]' = (), overwrite: 'bool' = False) -> 'IntLibBuildResult'Create an IntLib from ordered prepared source libraries. method extract_sources(self, output_dir: 'str | Path', *, overwrite: 'bool' = True, use_original_filenames: 'bool' = True, write_libpkg: 'bool' = True) -> 'IntLibExtractionResult'Extract embedded source streams from the integrated library. classmethod from_file(cls, filepath: 'str | Path') -> "'AltiumIntLib'"Open an integrated library from disk. method get_source_entries(self) -> 'tuple[IntLibSource, ...]'Return unique embedded source streams that can be extracted. method read_stream(self, stream_path: 'str', *, decompress: 'bool' = True) -> 'bytes'Read one OLE stream from the integrated library. property stream_paths -> 'tuple[str, ...]'OLE stream paths in the integrated library using `/` separators.
class
DraftsmanColor from altium_monkey import DraftsmanColor
class DraftsmanColor ( a: 'int' = 255 , r: 'int' = 0 , g: 'int' = 0 , b: 'int' = 0 ) -> 'None'
ARGB color value used by Draftsman XML color fields.
Members (4) Kind Signature Summary classmethod from_element(cls, element: 'etree._Element') -> 'Self | None'Read a Draftsman color from an XML element. property hex_rgb -> 'str'Return the color as `#RRGGBB`, ignoring alpha. classmethod rgb(cls, r: 'int', g: 'int', b: 'int') -> 'Self'Create an opaque color from RGB channels. method write_to_element(self, element: 'etree._Element') -> 'None'Write this color into an existing Draftsman color XML element.
class
DraftsmanFontStyle from altium_monkey import DraftsmanFontStyle
class DraftsmanFontStyle ( id: 'int' , family_name: 'str | None' , size: 'float' , decorations: 'DraftsmanFontDecoration' = < DraftsmanFontDecoration . NONE : 0 >) -> 'None'
Document-level Draftsman font style.
Draftsman stores font family names, sizes, and decoration flags in the `.PCBDwf` document. The document format does not embed custom font payloads in this style pool; callers should ensure custom families are installed on machines that open or render the document.
Members (4) Kind Signature Summary property bold -> 'bool'Return true when the style has the bold decoration flag. property italic -> 'bool'Return true when the style has the italic decoration flag. property strikeout -> 'bool'Return true when the style has the strikeout decoration flag. property underline -> 'bool'Return true when the style has the underline decoration flag.
class
DraftsmanMargin from altium_monkey import DraftsmanMargin
class DraftsmanMargin ( left_mm: 'float' , top_mm: 'float' , right_mm: 'float' , bottom_mm: 'float' ) -> 'None'
Draftsman page margins in millimeters.
class
DraftsmanPoint from altium_monkey import DraftsmanPoint
class DraftsmanPoint ( x_mm: 'float' , y_mm: 'float' ) -> 'None'
Point in Draftsman page coordinates, in millimeters.
Draftsman page coordinates use a lower-left origin: X increases to the right and Y increases toward the top of the sheet. Use `AltiumDraftsmanPage.point_from_top_left(...)` when placing objects by visual top-left offsets.
class
DraftsmanRect from altium_monkey import DraftsmanRect
class DraftsmanRect ( x_mm: 'float' , y_mm: 'float' , width_mm: 'float' , height_mm: 'float' ) -> 'None'
Rectangle in Draftsman page coordinates, in millimeters.
`x_mm` and `y_mm` use Draftsman's lower-left page origin. Width and height are positive dimensions in millimeters.
class
DraftsmanSize from altium_monkey import DraftsmanSize
class DraftsmanSize ( width_mm: 'float' , height_mm: 'float' ) -> 'None'
Two-dimensional Draftsman size in millimeters.
class
IntLibBuildResult from altium_monkey import IntLibBuildResult
class IntLibBuildResult ( output_path: 'Path' , output_sha256: 'str' , sources: 'tuple[IntLibBuildSource, ...]' , component_count: 'int' , footprint_count: 'int' , model_count: 'int' , parameter_record_count: 'int' , source_count: 'int' , warnings: 'tuple[IntLibBuildWarning, ...]' ) -> 'None'
Immutable summary returned after a validated IntLib is published.
class
IntLibBuildSource from altium_monkey import IntLibBuildSource
class IntLibBuildSource ( kind: "Literal['SchLib', 'PCBLib']" , logical_name: 'str' , stream_path: 'str' , sha256: 'str' , entity_count: 'int' ) -> 'None'
One immutable source packaged by an IntLib build.
class
IntLibBuildWarning from altium_monkey import IntLibBuildWarning
class IntLibBuildWarning ( code: 'IntLibBuildWarningCode' , subject: 'str' , message: 'str' ) -> 'None'
One non-fatal condition reported by an IntLib build.
class
IntLibComponent from altium_monkey import IntLibComponent
class IntLibComponent ( name: 'str' , virtual_path: 'str' , description: 'str' , source_path: 'str' , models: 'tuple[IntLibModel, ...]' ) -> 'None'
Component entry referenced by an integrated library.
Attributes: name: Component library reference. virtual_path: Integrated-library schematic source stream path. description: Component description from `LibCrossRef.Txt`. source_path: Original source path captured by Altium at compile time. models: Model entries associated with this component.
class
IntLibModel from altium_monkey import IntLibModel
class IntLibModel ( name: 'str' , model_type: 'str' , virtual_path: 'str | None' = None , source_path: 'str | None' = None ) -> 'None'
Model entry referenced by one component in an integrated library.
Attributes: name: Model name stored in `LibCrossRef.Txt`. model_type: Native model type label such as `PCBLIB` or `SI`. virtual_path: Integrated-library stream path, or `None` for models stored only as component metadata. source_path: Original source path captured by Altium at compile time, or `None` when the model has no embedded source stream.
class
IntLibSource from altium_monkey import IntLibSource
class IntLibSource ( kind: 'str' , stream_path: 'str' , original_path: 'str | None' , suggested_filename: 'str' , output_path: 'Path | None' = None ) -> 'None'
One extractable source stream inside an integrated library.
Attributes: kind: Top-level source family, for example `SchLib`, `PCBLib`, or `PCB3DLib`. stream_path: OLE stream path using `/` separators. original_path: Original path recorded by Altium, if present. suggested_filename: Safe output filename inferred from the original path or stream name. output_path: File path written by `AltiumIntLib.extract_sources`, or `None` before extraction.
enum
DraftsmanFontDecoration from altium_monkey import DraftsmanFontDecoration
enum DraftsmanFontDecoration
Draftsman font decoration flags stored in a font style's `DecorationsV2`.
Members (4) Kind Signature Summary member ITALIC= 1member BOLD= 2member UNDERLINE= 4member STRIKEOUT= 8
enum
DraftsmanHorizontalAlignment from altium_monkey import DraftsmanHorizontalAlignment
enum DraftsmanHorizontalAlignment
Horizontal alignment labels used by Draftsman text items.
Members (4) Kind Signature Summary member LEFT= 'Left'member CENTER= 'Center'member RIGHT= 'Right'member STRETCH= 'Stretch'
enum
DraftsmanNoteBorderStyle from altium_monkey import DraftsmanNoteBorderStyle
enum DraftsmanNoteBorderStyle
Draftsman note/callout reference border style.
Members (11) Kind Signature Summary member NONE= 0member SQUARE= 1member CIRCLE= 2member TRIANGLE= 3member UNDERLINE= 4member BOX= 5member OBLONG= 6member CIRCLE_GOST= 7member TRIANGLE_GOST= 8member HEXAGON= 9member FLAG= 10
enum
DraftsmanStandardSheetSize from altium_monkey import DraftsmanStandardSheetSize
enum DraftsmanStandardSheetSize
Standard Draftsman sheet sizes, in millimeters.
Members (13) Kind Signature Summary member A0= ('A0', 1189.0, 841.0)member A1= ('A1', 841.0, 594.0)member A2= ('A2', 594.0, 420.0)member A3= ('A3', 420.0, 297.0)member A4= ('A4', 297.0, 210.0)member ANSI_A= ('ANSI A', 279.0, 216.0)member ANSI_B= ('ANSI B', 432.0, 279.0)member ANSI_C= ('ANSI C', 559.0, 432.0)member ANSI_D= ('ANSI D', 864.0, 559.0)member ANSI_E= ('ANSI E', 1118.0, 864.0)member LETTER= ('Letter', 279.0, 216.0)member LEGAL= ('Legal', 356.0, 216.0)member TABLOID= ('Tabloid', 432.0, 279.0)
enum
DraftsmanVerticalAlignment from altium_monkey import DraftsmanVerticalAlignment
enum DraftsmanVerticalAlignment
Vertical alignment labels used by Draftsman text items.
Members (4) Kind Signature Summary member TOP= 'Top'member CENTER= 'Center'member BOTTOM= 'Bottom'member STRETCH= 'Stretch'
enum
IntLibBuildWarningCode from altium_monkey import IntLibBuildWarningCode
enum IntLibBuildWarningCode
Stable warning codes returned by the IntLib writer.
Members (1) Kind Signature Summary member UNUSED_FOOTPRINT= 'unused_footprint'