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
| Name | Type | Get/Set | Brief |
|---|---|---|---|
| Areas | Array[Area] | Yes/No | The list of areas on this design. |
| AssocParts | Array[AssociatedPart] | Yes/No | The list of associated parts on this design. |
| AttributeNames | Array[AttributeName] | Yes/No | The list of attribute names on this design. |
| Author | str | Yes/Yes | The “Author” field from the document properties. |
| BasePathName | str | Yes/No | The full path name of the design document, excluding the file extension and its preceding dot. |
| Boards | Array[Board] | Yes/No | The list of boards on this design. |
| Callouts | Array[Callout] | Yes/No | The list of callouts on this design. |
| CamPlots | Array[CamPlot] | Yes/No | The list of CAM/Plots on this design. |
| Comments | str | Yes/Yes | The “Comments” field from the document properties. |
| Components | Array[Component] | Yes/No | The list of components on this design. |
| Copper | Array[Copper] | Yes/No | The list of copper shapes on this design. |
| DiffPairChains | Array[DiffPairChain] | Yes/No | The list of differential pair chains on this design. |
| DifferentialPairs | Array[DiffPair] | Yes/No | The list of differential pairs on this design. |
| DocShapes | Array[DocShape] | Yes/No | The list of documentation shapes on this design. |
| EditingTime | int | Yes/Yes | The “Editing Time” field from the document properties. |
| Errors | Array[Error] | Yes/No | The list of error items on this design. |
| FileExtension | str | Yes/No | The file extension of the design file including its preceding dot. |
| FileName | str | Yes/No | The filename and extension of this design document. |
| FullPathName | str | Yes/No | The fully-qualified path to the design document. |
| Groups | Array[Group] | Yes/No | The list of groups on this design. |
| IsPcb | bool | Yes/No | Whether this is a PCB design file. |
| IsScm | bool | Yes/No | Whether this is a schematic design file. |
| Keywords | str | Yes/Yes | The “Keywords” fields from the document properties. |
| LastSavedBy | str | Yes/Yes | The “Last Saved By” field from the document properties. |
| LayerClasses | Array[LayerClass] | Yes/No | The list of layer classes on this design. |
| LayerSpans | Array[LayerSpan] | Yes/No | The list of layer spans on this design. |
| Layers | Array[Layer] | Yes/No | The list of layers on this design. |
| LineStyles | Array[LineStyle] | Yes/No | The list of line styles on this design. |
| Materials | Array[Material] | Yes/No | The list of materials on this design. |
| MountingHoles | Array[MountingHole] | Yes/No | The list of mounting holes on this design. |
| Name | str | Yes/Yes | The filename name of the design document, or the name of the symbol it stores if the design is from a symbol library. |
| NetClasses | Array[NetClass] | Yes/No | The list of net classes on this design. |
| Nets | Array[Net] | Yes/No | The list of nets on this design. |
| PadStyles | Array[PadStyle] | Yes/No | The list of pad styles on this design. |
| Pads | Array[Pad] | Yes/No | The list of pads on this design. |
| Pages | Array[Page] | Yes/No | The list of pages on this design. |
| Parts | Array[Part] | Yes/No | The list of parts on this design. |
| RevisionNumber | int | Yes/Yes | The “Revision Number” field from the document properties. |
| Savable | bool | Yes/No | Whether the design can be saved. |
| SignalPaths | Array[SignalPath] | Yes/No | The list of signal paths on this design. |
| Subject | str | Yes/Yes | The “Subject” field from the document properties. |
| SymbolInstances | Array[SymbolInstance] | Yes/No | The list of symbol instances on this design. |
| Symbols | Array[Symbol] | Yes/No | The list of symbols on this design. |
| TechnologyFilePath | Variant[str, none] | Yes/No | The fully qualified path name of the technology file on which this design is based, if one exists. |
| Templates | Array[Template] | Yes/No | The list of templates on this design. |
| TextStyles | Array[TextStyle] | Yes/No | The list of text styles on this design. |
| Texts | Array[Text] | Yes/No | The list of text items on this design. |
| Title | str | Yes/Yes | The “Title” field from the document properties. |
| TrackStyles | Array[TrackStyle] | Yes/No | The list of track styles on this design. |
| Type | Type | Yes/No | The type of this design. |
| UnitPrecision | int | Yes/Yes | The precision to be displayed for units on this design, in decimal places. |
| Units | str | Yes/Yes | 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 | Variant[Variant, none] | Yes/Yes | Selected variant, or nothing if using the master variant. |
| Variants | Array[Variant] | Yes/No | The list of variants on this design. |
Methods
| Name | Returns | Arguments |
|---|---|---|
| AddAttributeName | AttributeName | name : strusage : Variant[Usage, none] |
| AddComponent | Component | partName : strcomponentName : strpartRepresentationName : Variant[ str, none] |
| AddLineStyle | LineStyle | name : str |
| AddNet | Net | netName : Variant[str, none]netClassName : Variant[ str, none]localNet : Variant[ bool, none] |
| AddPadStyle | PadStyle | name : str |
| AddTextStyle | TextStyle | name : str |
| AnalyseDesignRevision | none | reference : strxmlSettingsPath : Variant[ str, none]reportFile : Variant[ str, none] |
| ArrangeComponents | none | |
| AutoGenPlots | none | settingsFile : str |
| CheckRules | none | |
| CrossProbe | none | category : CrossProbeCat itemName : str |
| DeleteAttributePosition | bool | attributeName : strlayer : Variant[Layer, none] |
| DeleteLineStyle | none | style : LineStyle |
| DeletePadStlye | none | style : PadStyle |
| DeleteTextStyle | none | style : TextStyle |
| DeselectAll | none | |
| DsuToString | str | dsu : intindicator : Variant[ bool, none]precision : Variant[ int, none] |
| DsuToStringX | str | dsu : intindicator : Variant[ bool, none]precision : Variant[ int, none]useOrigin : Variant[ bool, none] |
| DsuToStringY | str | dsu : intindicator : Variant[ bool, none]precision : Variant[ int, none]useOrigin : Variant[ bool, none] |
| ExportLibraryItem | none | directory : str |
| FrameViewOn | none | rect : Rectanglepage : Variant[Page, none] |
| FromDsu | float | dsu : int |
| FromDsuX | float | measure : intuseOrigin : Variant[ bool, none] |
| FromDsuY | float | measure : intuseOrigin : Variant[ bool, none] |
| GenerateIbom | none | xmlSettingsPath : Variant[str, none] |
| GenerateIpc2581 | none | outputPath : strxmlSettingsPath : Variant[ str, none] |
| GenerateOdb | none | outputPath : strxmlSettingsPath : Variant[ str, none] |
| GenerateStep | none | outputPath : strxmlSettingsPath : Variant[ str, none] |
| GetDsuRatio | float | |
| ImportLayerStack | none | path : str |
| LoadProfile | none | path : str |
| LoadTechnology | bool | path : str |
| NewPlotWriter | PlotWriter | |
| RunReport | none | reportName : stroutputPath : str |
| Save | none | |
| SaveAs | none | path : str |
| SaveCopyAs | none | path : str |
| ToDsu | int | measure : float |
| ToDsuX | int | measure : floatuseOrigin : Variant[ bool, none] |
| ToDsuY | int | measure : floatuseOrigin : Variant[ bool, none] |
Enumerations
CrossProbeCat
Categories of items which can be cross-probed.
| Name | Value | Description |
|---|---|---|
| Component | 0 | No description provided. |
| Net | 1 | No description provided. |
| Pad | 2 | No description provided. |
Type
Categories of designs.
| Name | Value | Description |
|---|---|---|
| Pcb | 0 | PCB design. |
| Schematic | 1 | Schematic design. |
| Block | 2 | Schematic hierarchy block. |
| Footprint | 3 | PCB footprint. |
| Symbol | 4 | Schematic symbol. |
| ScmDocSymbol | 5 | Schematic documentation symbol. |
| PcbDocSymbol | 6 | PCB documentation symbol. |
| Part | 7 | Part. |
| PcbTech | 8 | PCB technology file. |
| ScmTech | 9 | Schematic technology file. |
| PartTech | 10 | Part technology file. |
| PcbProfile | 11 | PCB profile file. |
| ScmProfile | 12 | Schematic profile file. |
| Panel | 13 | PCB panel design. |
| PanelProfile | 14 | PCB 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:strusage: Variant[Usage,none]
AddComponent
Add a new component to the component bin in the design.
Returns Component.
Arguments:
partName:strcomponentName:strpartRepresentationName: 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:strxmlSettingsPath: 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:
category: CrossProbeCatitemName:str
DeleteAttributePosition
Delete an attribute position from the design.
Returns bool.
Arguments:
attributeName:strlayer: Variant[Layer,none]
DeleteLineStyle
Delete a line style from the design.
Arguments:
style: LineStyle
DeletePadStlye
Delete a pad style from the design.
Arguments:
style: PadStyle
DeleteTextStyle
Delete a text style from the design.
Arguments:
style: TextStyle
DeselectAll
Deselects all the items from the design.
DsuToString
Convert a DSU distance measure into a user unit measure.
Returns str.
Arguments:
dsu:intindicator: Variant[bool,none]precision: Variant[int,none]
DsuToStringX
Convert an X coordinate in DSUs to a user unit.
Returns str.
Arguments:
dsu:intindicator: 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:intindicator: 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:Rectanglepage: Variant[Page,none]
FromDsu
Convert from DSUs to user units.
Returns float.
Arguments:
dsu:int
FromDsuX
Returns float.
Arguments:
measure:intuseOrigin: Variant[bool,none]
FromDsuY
Returns float.
Arguments:
measure:intuseOrigin: 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:stroutputPath: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:floatuseOrigin: Variant[bool,none]
ToDsuY
Returns int.
Arguments:
measure:floatuseOrigin: Variant[bool,none]