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

NameReturnsArguments
ActivateOtherDesignnone
ActiveDocumentVariant[Document, none]
AddComponentOnCursornonecomponent : str
package : str
library : str
AddToLibrarynonedataFile : str
libType : LibraryType
libPath : str
overwrite : Variant[bool, none]
BrowseExistingLibraryVariant[str, none]type : LibraryType
BrowseNewLibraryVariant[str, none]type : LibraryType
promptOverwrite : Variant[bool, none]
Closenonedesign : Document
CreateLibrarynonetype : LibraryType
path : str
Deletenoneobject : ScriptObject
Forgetnoneitem : DesignItem
GetDocumentCountint
GetDocumentsArray[Document]
GetFoldersFolders
GetLibraryNamesArray[str]libraryType : LibraryType
GetVersionstr
IsDualScreenbool
IsPcbbool
IsScmbool
LoadConfigurationnonepath : str
OpenDocumentDocumentpath : str
OpenPartLibraryPartLibrarypathName : str
readOnly : Variant[bool, none]
OpenSymbolLibrarySymbolLibrarypathName : str
readOnly : Variant[bool, none]
QuitAppnone
RunCommandnonecommandName : str
RunLibraryReportnonereportName : str
outputPath : str
libraryName : Variant[str, none]
SetPlotOutputTemplatenonetemplateString : str
VaultExportnonerootFolder : str
vaultFolderName : Variant[str, none]
subFolders : Variant[bool, none]
vaultLibType : Variant[LibraryType, none]

Enumerations

LibraryType

Library types used across the scripting API.

NameValueDescription
Unknown0Unspecified type.
Component1Component (part) library.
Footprint2PCB symbol library.
Symbol3Schematic symbol library.
PcbDocSymbol4PCB documentation symbol library.
ScmDocSymbol5Schematic documentation symbol library.
Package63D Package library, an alternative to STEP libraries.
StepModel7STEP 3D model library.
SpiceModel8SPICE 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:


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:


Forget

Unassign this design item’s script object.

Arguments:


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:


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]