Inherits: Document < DesignItem < ScriptObject

A document is the main interface to the contents of a design, containing many other items that can be accessed.

Properties

NameTypeGet/SetBrief
AreasArray[Area]Yes/NoThe list of areas on this design.
AssocPartsArray[AssociatedPart]Yes/NoThe list of associated parts on this design.
AttributeNamesArray[AttributeName]Yes/NoThe list of attribute names on this design.
AuthorstrYes/YesThe “Author” field from the document properties.
BasePathNamestrYes/NoThe full path name of the design document, excluding the file extension and its preceding dot.
BoardsArray[Board]Yes/NoThe list of boards on this design.
CalloutsArray[Callout]Yes/NoThe list of callouts on this design.
CamPlotsArray[CamPlot]Yes/NoThe list of CAM/Plots on this design.
CommentsstrYes/YesThe “Comments” field from the document properties.
ComponentsArray[Component]Yes/NoThe list of components on this design.
CopperArray[Copper]Yes/NoThe list of copper shapes on this design.
DiffPairChainsArray[DiffPairChain]Yes/NoThe list of differential pair chains on this design.
DifferentialPairsArray[DiffPair]Yes/NoThe list of differential pairs on this design.
DocShapesArray[DocShape]Yes/NoThe list of documentation shapes on this design.
EditingTimeintYes/YesThe “Editing Time” field from the document properties.
ErrorsArray[Error]Yes/NoThe list of error items on this design.
FileExtensionstrYes/NoThe file extension of the design file including its preceding dot.
FileNamestrYes/NoThe filename and extension of this design document.
FullPathNamestrYes/NoThe fully-qualified path to the design document.
GroupsArray[Group]Yes/NoThe list of groups on this design.
IsPcbboolYes/NoWhether this is a PCB design file.
IsScmboolYes/NoWhether this is a schematic design file.
KeywordsstrYes/YesThe “Keywords” fields from the document properties.
LastSavedBystrYes/YesThe “Last Saved By” field from the document properties.
LayerClassesArray[LayerClass]Yes/NoThe list of layer classes on this design.
LayerSpansArray[LayerSpan]Yes/NoThe list of layer spans on this design.
LayersArray[Layer]Yes/NoThe list of layers on this design.
LineStylesArray[LineStyle]Yes/NoThe list of line styles on this design.
MaterialsArray[Material]Yes/NoThe list of materials on this design.
MountingHolesArray[MountingHole]Yes/NoThe list of mounting holes on this design.
NamestrYes/YesThe filename name of the design document, or the name of the symbol it stores if the design is from a symbol library.
NetClassesArray[NetClass]Yes/NoThe list of net classes on this design.
NetsArray[Net]Yes/NoThe list of nets on this design.
PadStylesArray[PadStyle]Yes/NoThe list of pad styles on this design.
PadsArray[Pad]Yes/NoThe list of pads on this design.
PagesArray[Page]Yes/NoThe list of pages on this design.
PartsArray[Part]Yes/NoThe list of parts on this design.
RevisionNumberintYes/YesThe “Revision Number” field from the document properties.
SavableboolYes/NoWhether the design can be saved.
SignalPathsArray[SignalPath]Yes/NoThe list of signal paths on this design.
SubjectstrYes/YesThe “Subject” field from the document properties.
SymbolInstancesArray[SymbolInstance]Yes/NoThe list of symbol instances on this design.
SymbolsArray[Symbol]Yes/NoThe list of symbols on this design.
TechnologyFilePathVariant[str, none]Yes/NoThe fully qualified path name of the technology file on which this design is based, if one exists.
TemplatesArray[Template]Yes/NoThe list of templates on this design.
TextStylesArray[TextStyle]Yes/NoThe list of text styles on this design.
TextsArray[Text]Yes/NoThe list of text items on this design.
TitlestrYes/YesThe “Title” field from the document properties.
TrackStylesArray[TrackStyle]Yes/NoThe list of track styles on this design.
TypeTypeYes/NoThe type of this design.
UnitPrecisionintYes/YesThe precision to be displayed for units on this design, in decimal places.
UnitsstrYes/YesThe short name of the design’s unit for coordinates and distances. Can be one of “inch”, “mils”/“thou”, “m”, “cm”, “mm” or “micron”.
VariantVariant[Variant, none]Yes/YesSelected variant, or nothing if using the master variant.
VariantsArray[Variant]Yes/NoThe list of variants on this design.

Methods

NameReturnsArguments
AddAttributeNameAttributeNamename : str
usage : Variant[Usage, none]
AddComponentComponentpartName : str
componentName : str
partRepresentationName : Variant[str, none]
AddLineStyleLineStylename : str
AddNetNetnetName : Variant[str, none]
netClassName : Variant[str, none]
localNet : Variant[bool, none]
AddPadStylePadStylename : str
AddTextStyleTextStylename : str
AnalyseDesignRevisionnonereference : str
xmlSettingsPath : Variant[str, none]
reportFile : Variant[str, none]
ArrangeComponentsnone
AutoGenPlotsnonesettingsFile : str
CheckRulesnone
CrossProbenonecategory : CrossProbeCat
itemName : str
DeleteAttributePositionboolattributeName : str
layer : Variant[Layer, none]
DeleteLineStylenonestyle : LineStyle
DeletePadStlyenonestyle : PadStyle
DeleteTextStylenonestyle : TextStyle
DeselectAllnone
DsuToStringstrdsu : int
indicator : Variant[bool, none]
precision : Variant[int, none]
DsuToStringXstrdsu : int
indicator : Variant[bool, none]
precision : Variant[int, none]
useOrigin : Variant[bool, none]
DsuToStringYstrdsu : int
indicator : Variant[bool, none]
precision : Variant[int, none]
useOrigin : Variant[bool, none]
ExportLibraryItemnonedirectory : str
FrameViewOnnonerect : Rectangle
page : Variant[Page, none]
FromDsufloatdsu : int
FromDsuXfloatmeasure : int
useOrigin : Variant[bool, none]
FromDsuYfloatmeasure : int
useOrigin : Variant[bool, none]
GenerateIbomnonexmlSettingsPath : Variant[str, none]
GenerateIpc2581noneoutputPath : str
xmlSettingsPath : Variant[str, none]
GenerateOdbnoneoutputPath : str
xmlSettingsPath : Variant[str, none]
GenerateStepnoneoutputPath : str
xmlSettingsPath : Variant[str, none]
GetDsuRatiofloat
ImportLayerStacknonepath : str
LoadProfilenonepath : str
LoadTechnologyboolpath : str
NewPlotWriterPlotWriter
RunReportnonereportName : str
outputPath : str
Savenone
SaveAsnonepath : str
SaveCopyAsnonepath : str
ToDsuintmeasure : float
ToDsuXintmeasure : float
useOrigin : Variant[bool, none]
ToDsuYintmeasure : float
useOrigin : Variant[bool, none]

Enumerations

CrossProbeCat

Categories of items which can be cross-probed.

NameValueDescription
Component0No description provided.
Net1No description provided.
Pad2No description provided.

Type

Categories of designs.

NameValueDescription
Pcb0PCB design.
Schematic1Schematic design.
Block2Schematic hierarchy block.
Footprint3PCB footprint.
Symbol4Schematic symbol.
ScmDocSymbol5Schematic documentation symbol.
PcbDocSymbol6PCB documentation symbol.
Part7Part.
PcbTech8PCB technology file.
ScmTech9Schematic technology file.
PartTech10Part technology file.
PcbProfile11PCB profile file.
ScmProfile12Schematic profile file.
Panel13PCB panel design.
PanelProfile14PCB panel profile file.

Property Details

Areas

Type: Array[Area]

The list of areas on this design.


AssocParts

Type: Array[AssociatedPart]

The list of associated parts on this design.


AttributeNames

Type: Array[AttributeName]

The list of attribute names on this design.


Author

Type: str

The “Author” field from the document properties.


BasePathName

Type: str

The full path name of the design document, excluding the file extension and its preceding dot.


Boards

Type: Array[Board]

The list of boards on this design.


Callouts

Type: Array[Callout]

The list of callouts on this design.


CamPlots

Type: Array[CamPlot]

The list of CAM/Plots on this design.


Comments

Type: str

The “Comments” field from the document properties.


Components

Type: Array[Component]

The list of components on this design.


Copper

Type: Array[Copper]

The list of copper shapes on this design.


DiffPairChains

Type: Array[DiffPairChain]

The list of differential pair chains on this design.


DifferentialPairs

Type: Array[DiffPair]

The list of differential pairs on this design.


DocShapes

Type: Array[DocShape]

The list of documentation shapes on this design.


EditingTime

Type: int

The “Editing Time” field from the document properties.


Errors

Type: Array[Error]

The list of error items on this design.


FileExtension

Type: str

The file extension of the design file including its preceding dot.


FileName

Type: str

The filename and extension of this design document.


FullPathName

Type: str

The fully-qualified path to the design document.


Groups

Type: Array[Group]

The list of groups on this design.


IsPcb

Type: bool

Whether this is a PCB design file.


IsScm

Type: bool

Whether this is a schematic design file.


Keywords

Type: str

The “Keywords” fields from the document properties.


LastSavedBy

Type: str

The “Last Saved By” field from the document properties.


LayerClasses

Type: Array[LayerClass]

The list of layer classes on this design.


LayerSpans

Type: Array[LayerSpan]

The list of layer spans on this design.


Layers

Type: Array[Layer]

The list of layers on this design.


LineStyles

Type: Array[LineStyle]

The list of line styles on this design.


Materials

Type: Array[Material]

The list of materials on this design.


MountingHoles

Type: Array[MountingHole]

The list of mounting holes on this design.


Name

Type: str

The filename name of the design document, or the name of the symbol it stores if the design is from a symbol library.


NetClasses

Type: Array[NetClass]

The list of net classes on this design.


Nets

Type: Array[Net]

The list of nets on this design.


PadStyles

Type: Array[PadStyle]

The list of pad styles on this design.


Pads

Type: Array[Pad]

The list of pads on this design.


Pages

Type: Array[Page]

The list of pages on this design.


Parts

Type: Array[Part]

The list of parts on this design.


RevisionNumber

Type: int

The “Revision Number” field from the document properties.


Savable

Type: bool

Whether the design can be saved.


SignalPaths

Type: Array[SignalPath]

The list of signal paths on this design.


Subject

Type: str

The “Subject” field from the document properties.


SymbolInstances

Type: Array[SymbolInstance]

The list of symbol instances on this design.


Symbols

Type: Array[Symbol]

The list of symbols on this design.


TechnologyFilePath

Type: Variant[str, none]

The fully qualified path name of the technology file on which this design is based, if one exists.


Templates

Type: Array[Template]

The list of templates on this design.


TextStyles

Type: Array[TextStyle]

The list of text styles on this design.


Texts

Type: Array[Text]

The list of text items on this design.


Title

Type: str

The “Title” field from the document properties.


TrackStyles

Type: Array[TrackStyle]

The list of track styles on this design.


Type

Type: Type

The type of this design.


UnitPrecision

Type: int

The precision to be displayed for units on this design, in decimal places.


Units

Type: str

The short name of the design’s unit for coordinates and distances. Can be one of “inch”, “mils”/“thou”, “m”, “cm”, “mm” or “micron”.


Variant

Type: Variant[Variant, none]

Selected variant, or nothing if using the master variant.


Variants

Type: Array[Variant]

The list of variants on this design.

Method Details

AddAttributeName

Adds an attribute name to the design.

Returns AttributeName.

Arguments:

  • name : str
  • usage : Variant[Usage, none]

AddComponent

Add a new component to the component bin in the design.

Returns Component.

Arguments:

  • partName : str
  • componentName : str
  • partRepresentationName : Variant[str, none]

AddLineStyle

Add a new solid line style to the design.

Returns LineStyle.

Arguments:

  • name : str

AddNet

Add a new net to the design.

Returns Net.

Arguments:

  • netName : Variant[str, none] - Leave empty or as “None” to use a default name.
  • netClassName : Variant[str, none]
  • localNet : Variant[bool, none] - Specify if this is to be a local net (schematic only).

AddPadStyle

Add a new rectangular pad style to the design.

Returns PadStyle.

Arguments:

  • name : str

AddTextStyle

Add a new stroke text style to the design.

Returns TextStyle.

Arguments:

  • name : str

AnalyseDesignRevision

Compare this design with a reference design.

Arguments:

  • reference : str
  • xmlSettingsPath : Variant[str, none]
  • reportFile : Variant[str, none]

ArrangeComponents

Arrange all the components in the design, stacked by part. Schematic and PCB only.


AutoGenPlots

Auto-generate CAM/Plots in a PCB design. The device names for each type of layer correspond to the choices on the Auto Generate dialog.

Arguments:

  • settingsFile : str

CheckRules

Run the Design Rule Check or Electrical Rule Check option using the current settings.


CrossProbe

Cross probe to select a design item.

Arguments:


DeleteAttributePosition

Delete an attribute position from the design.

Returns bool.

Arguments:

  • attributeName : str
  • layer : Variant[Layer, none]

DeleteLineStyle

Delete a line style from the design.

Arguments:


DeletePadStlye

Delete a pad style from the design.

Arguments:


DeleteTextStyle

Delete a text style from the design.

Arguments:


DeselectAll

Deselects all the items from the design.


DsuToString

Convert a DSU distance measure into a user unit measure.

Returns str.

Arguments:

  • dsu : int
  • indicator : Variant[bool, none]
  • precision : Variant[int, none]

DsuToStringX

Convert an X coordinate in DSUs to a user unit.

Returns str.

Arguments:

  • dsu : int
  • indicator : Variant[bool, none]
  • precision : Variant[int, none]
  • useOrigin : Variant[bool, none]

DsuToStringY

Convert a Y coordinate in DSUs to a user unit.

Returns str.

Arguments:

  • dsu : int
  • indicator : Variant[bool, none]
  • precision : Variant[int, none]
  • useOrigin : Variant[bool, none]

ExportLibraryItem

Export the library item to the specified directory.

Arguments:

  • directory : str

FrameViewOn

Frame the view on the given rectangle. A page must be provided for schematics.

Arguments:

  • rect : Rectangle
  • page : Variant[Page, none]

FromDsu

Convert from DSUs to user units.

Returns float.

Arguments:

  • dsu : int

FromDsuX

Returns float.

Arguments:

  • measure : int
  • useOrigin : Variant[bool, none]

FromDsuY

Returns float.

Arguments:

  • measure : int
  • useOrigin : Variant[bool, none]

GenerateIbom

Generate an Interactive HTML BOM from the design.

If no XML settings are given or a particular setting is not specified, the current default value (from the registry) for that setting will be used.

The XML settings file may contain the top-level elements outlined below.

Boolean values: “CompressExportData”, “OpenWhenComplete”, “ExportComponentPads”, “ExportFreePads”, “ExportTracks”, “ExportCopper”, “ExportNets”, “ExportTestpoints”, “ExportMountingHoles”, “ExportDocShapes”, “ExportWires”, “DarkMode”, “ShowPads”, “HideSilkscreen”, “HideFabrication”, “RedrawOnDrag”, “OffsetBackRotation”, “IncludeAssociatedParts”, “IncludeFreePads”, “IncludeTestpoints”, “IncludeMountingHoles”.

String values: “OutputFileFolder”, “OutputFileName”, “SilkscreenClass”, “FabricationClass”, “Checkboxes”, “Blacklist”, “PythonExecutable”, “DnpFieldName”.

String values as seen in the export dialog: “HighlightFirstPin”, “DefaultView”, “DefaultLayers”.

String values in multiple “Attribute” elements can be specified.

Licences required: Export IBOM.

Arguments:

  • xmlSettingsPath : Variant[str, none] - A path to an XML file containing configuration settings for the output.

GenerateIpc2581

Generate an IPC-2581 output from the design.

If no XML settings are given or a particular setting is not specified, the current default value (from the registry) for that setting will be used.

The XML settings file may contain the top-level elements outlined below:

Boolean values: “Compressed”, “UseCamPlot”, “IncludeWindows”, “NeutralNetNames”, “OmitBOMData”, “FunctionalLevel”.

String values: “SilkLayerClass”, “MaskLayerClass”, “PasteLayerClass”, “AssemblyLayerClass”, “Units”, “FunctionalMode”

“FunctionalMode” may be one of: “FULL”, “DESIGN”, “FABRICATION”, “ASSEMBLY”, “TEST”.

“OmitBOMData” only applies to Fabrication mode.

Arguments:

  • outputPath : str - The path to create the output at.
  • xmlSettingsPath : Variant[str, none] - A path to an XML file containing configuration settings for the output.

GenerateOdb

Generate an ODB++ output from the design.

If no XML settings are given or a particular setting is not specified, the current default value (from the registry) for that setting will be used.

The XML settings file may contain the top-level elements outlined below:

Boolean values: “Compressed”, “UseCamPlot”, “IncludeWindows”, “OutputPositive”, “OutputPositive”, “OutputComposite”, “NeutralNetNames”, “OutputAllComponentDocShapes”, “OutputCompDoc”, “PinNamesInPackages”, “OutputPanelPcb”.

String values: “SilkLayerClass”, “MaskLayerClass”, “PasteLayerClass”.

Arguments:

  • outputPath : str - The path to create the output at.
  • xmlSettingsPath : Variant[str, none] - A path to an XML file containing configuration settings for the output.

GenerateStep

Generate a STEP file from the design.

If no XML settings are given or a particular setting is not specified, the current default value (from the registry) for that setting will be used.

The XML settings file may contain the top-level elements outlined below:

Boolean values: “MinStepFileSize”, “OutputMountingDrillHoles”, “NoComponents”, “OutputPads”, “OutputVias”, “OutputDrillHoles”, “OutputTracks”, “OutputCopper”, “OutputDocShapes”, “OutputText”, “SolidWorks”.

A string value in a “BoardThickness” element may be specified. This value can either be in current units or be suffixed by a unit name (e.g. “0.75mm”).

Arguments:

  • outputPath : str - The path to create the output at.
  • xmlSettingsPath : Variant[str, none] - A path to an XML file containing configuration settings for the output.

GetDsuRatio

Get the ratio of DSU length over user unit length. Multiplying DSU values by this ratio converts to user units.

Returns float.


ImportLayerStack

Import an XML stack-up file.

Arguments:

  • path : str

LoadProfile

Load the specified profile onto the current design.

Arguments:

  • path : str

LoadTechnology

Load the specified (full or partial) technology file into the current design.

Returns bool.

Arguments:

  • path : str

NewPlotWriter

Creates a PlotWriter object which you can use to generate CAMPlots from your design.

Returns PlotWriter.


RunReport

Run a format file report and write its output to the specified path.

Arguments:

  • reportName : str
  • outputPath : str

Save

Save the design file.


SaveAs

Save the design file to the specified path name, associating the open document with this path.

Arguments:

  • path : str

SaveCopyAs

Save a copy of the design file to the specified path name without affecting the open document.

Arguments:

  • path : str

ToDsu

Convert from user units to DSUs.

Returns int.

Arguments:

  • measure : float

ToDsuX

Returns int.

Arguments:

  • measure : float
  • useOrigin : Variant[bool, none]

ToDsuY

Returns int.

Arguments:

  • measure : float
  • useOrigin : Variant[bool, none]