Inherits: Application < ScriptObject
The application object is a singleton which represents the Pulsonix application.
It can be used to access designs, libraries, interactive elements, scripting objects and application settings. One instance of this class with an ID of zero will be created at the beginning of a scripting session.
Methods
| Name | Returns | Arguments |
|---|---|---|
| ActivateOtherDesign | none | |
| ActiveDocument | Variant[Document, none] | |
| AddComponentOnCursor | none | component : strpackage : strlibrary : str |
| AddToLibrary | none | dataFile : strlibType : LibraryType libPath : stroverwrite : Variant[ bool, none] |
| BrowseExistingLibrary | Variant[str, none] | type : LibraryType |
| BrowseNewLibrary | Variant[str, none] | type : LibraryType promptOverwrite : Variant[ bool, none] |
| Close | none | design : Document |
| CreateLibrary | none | type : LibraryType path : str |
| Delete | none | object : ScriptObject |
| Forget | none | item : DesignItem |
| GetDocumentCount | int | |
| GetDocuments | Array[Document] | |
| GetFolders | Folders | |
| GetLibraryNames | Array[str] | libraryType : LibraryType |
| GetVersion | str | |
| IsDualScreen | bool | |
| IsPcb | bool | |
| IsScm | bool | |
| LoadConfiguration | none | path : str |
| OpenDocument | Document | path : str |
| OpenPartLibrary | PartLibrary | pathName : strreadOnly : Variant[ bool, none] |
| OpenSymbolLibrary | SymbolLibrary | pathName : strreadOnly : Variant[ bool, none] |
| QuitApp | none | |
| RunCommand | none | commandName : str |
| RunLibraryReport | none | reportName : stroutputPath : strlibraryName : Variant[ str, none] |
| SetPlotOutputTemplate | none | templateString : str |
| VaultExport | none | rootFolder : strvaultFolderName : Variant[ str, none]subFolders : Variant[ bool, none]vaultLibType : Variant[LibraryType, none] |
Enumerations
LibraryType
Library types used across the scripting API.
| Name | Value | Description |
|---|---|---|
| Unknown | 0 | Unspecified type. |
| Component | 1 | Component (part) library. |
| Footprint | 2 | PCB symbol library. |
| Symbol | 3 | Schematic symbol library. |
| PcbDocSymbol | 4 | PCB documentation symbol library. |
| ScmDocSymbol | 5 | Schematic documentation symbol library. |
| Package | 6 | 3D Package library, an alternative to STEP libraries. |
| StepModel | 7 | STEP 3D model library. |
| SpiceModel | 8 | SPICE simulation model library. |
Method Details
ActivateOtherDesign
Activate the PCB or schematic design which matches the currently open design, opening it if necessary.
ActiveDocument
Get the currently focused document in the application, if any are open.
Returns Variant[Document, none].
This function will not return anything for documents which do not contain designs, such as part documents or technology files. To get these documents, use GetDocuments.
AddComponentOnCursor
Add the specified component onto the cursor.
Arguments:
component:str- Name of the component.package:str- Name of the package the component is in.library:str- Name of the library the component is in.
AddToLibrary
Add an item to the specified library.
Arguments:
dataFile:str- Path to the item data.libType: LibraryType - Type of library to add to.libPath:str- Path to the library to add the item to.overwrite: Variant[bool,none] - Whether to allow overwriting existing files, defaulting to false.
BrowseExistingLibrary
Open a file browser to specify a path for an existing library file.
Returns Variant[str, none]: The path chosen.
Arguments:
type: LibraryType - The type of library file to filter for.
BrowseNewLibrary
Open a file browser to specify a path for a new library file.
Returns Variant[str, none]: The path to the library.
Arguments:
type: LibraryType - The type of library to create.promptOverwrite: Variant[bool,none] - Whether to warn the user when selecting an existing file (defaulting to false).
Close
Close a design without saving it.
Arguments:
design: Document
CreateLibrary
Create a new library.
Arguments:
type: LibraryType - The type of library to create.path:str- The file path to create the library at.
Delete
Delete a helper object.
Arguments:
object: ScriptObject
Forget
Unassign this design item’s script object.
Arguments:
item: DesignItem
GetDocumentCount
The number of designs currently open.
Returns int.
GetDocuments
Get the currently open Pulsonix documents.
Returns Array[Document].
GetFolders
Returns Folders.
GetLibraryNames
Gets the names of all libraries matching the specified type.
Returns Array[str].
Arguments:
libraryType: LibraryType
GetVersion
Get the current Pulsonix version.
Returns str.
IsDualScreen
Whether the application is running under dual screen.
Returns bool.
IsPcb
Whether the application is a PCB instance in dual screen.
Returns bool.
IsScm
Whether the application is a schematic instance in dual screen.
Returns bool.
LoadConfiguration
Load an application configuration file.
Arguments:
path:str- Path to the configuration file.
OpenDocument
Opens the document at this fully qualified path and brings it into focus, even if the design is already open.
Returns Document.
Arguments:
path:str
OpenPartLibrary
Open a part library object, which can be used to access library data.
Returns PartLibrary.
Arguments:
pathName:str- Path to the library.readOnly: Variant[bool,none] - Whether to open the library in read-only mode (defaults to True).
OpenSymbolLibrary
Open a symbol library object, which can be used to access library data.
Returns SymbolLibrary.
Arguments:
pathName:str- The path to the library.readOnly: Variant[bool,none] - Whether to open the library in read-only mode (defaults to True).
QuitApp
Close the application, following the usual shutdown procedure, as if you had pressed “Exit” in the menus.
RunCommand
Run a named command from the “Run Command” dialog.
Arguments:
commandName:str
RunLibraryReport
Run a named library report. Will run on all libraries if one is not specified.
Arguments:
reportName:str- Identifier of the library report.outputPath:str- Path to save the report to.libraryName: Variant[str,none] - Name of the library to run the report on.
SetPlotOutputTemplate
Set the rules for the Output File Names Template as defined on the CAM/Plot dialog.
Arguments:
templateString:str
VaultExport
Export a copy of Vault library data to a given folder.
Arguments:
rootFolder:str- Folder to export into.vaultFolderName: Variant[str,none] - Vault folder name.subFolders: Variant[bool,none] - Whether to include subfolders.vaultLibType: Variant[LibraryType,none]