Inherits: PartLibrary < Library < ScriptObject

A part library is a collection of parts defined on the disk.

Parts 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 parts will be deleted as well.

Properties

NameTypeGet/SetBrief
PartsArray[Part]Yes/NoThe list of Document items in the library.

Methods

NameReturnsArguments
FindPartpartName : str
Importboolpath : str
RenameboolcurrentName : str
newName : str
RunReportnonereportName : str
outputPath : str
Writenonepart : Part

Property Details

Parts

Type: Array[Part]

The list of Document items in the library.

Method Details

Find

Retrieve the given part from the library.

Returns Part: The part found.

Arguments:

  • partName : str - Name of the part to retrieve.

Import

Write a Document to the library using the file path of the part.

Returns bool: Whether the write operation was successful.

Note that this operation may require additional licences.

Licences required: Scripting Advanced Features.

Arguments:

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

Rename

Rename the given Document in the library.

Returns bool: Whether the rename was successful.

Arguments:

  • currentName : str - Name of item to rename.
  • newName : str - The new name to give it.

RunReport

Runs the named report for the library to the specified path name.

Arguments:

  • reportName : str - What to name the report file.
  • outputPath : str - Where to save the report to.

Write

Write a part back to the library.

Arguments: