Inherits: SymbolLibrary < Library < ScriptObject

The SymbolLibrary object provides you with access to the contents of various symbol libraries.

Symbols read using this library object are valid in the scripting session only for as long as the library is valid. If the library object is deleted, the symbols will be deleted as well.

This class supports symbol and documentation symbol libraries for PCBs and Schematics.

Properties

NameTypeGet/SetBrief
SymbolsArray[Document]Yes/NoThe symbols in this library.

Methods

NameReturnsArguments
FindDocumentsymbolName : str
Importboolpath : str
RenamenonecurrentName : str
newName : str
Writeboolsymbol : Document

Property Details

Symbols

Type: Array[Document]

The symbols in this library.

Method Details

Find

Load a symbol from the library.

Returns Document: The symbol found.

Arguments:

  • symbolName : str - Name of the symbol to retrieve

Import

Write a document to the library using the file path of the symbol.

Returns bool: Whether the write operation was successful.

Licences required: Scripting Advanced Features.

Arguments:

  • path : str - The file path of the symbol to write into the library.

Rename

Rename a document in a library.

Arguments:

  • currentName : str - The name of the item to be renamed.
  • newName : str - The new name for the item.

Write

Write a symbol back to the library.

Returns bool: Whether the write operation was successful.

Arguments:

  • symbol : Document - The symbol to add.