IIntegratedLibraryManager interface
The IIntegratedLibraryManager interface represents the integrated library manager that manages schematic components and its models from installed libraries in Altium Designer.
public interface IIntegratedLibraryManager
Namespace: SCH · Assembly: Altium.SDK.Interfaces
Remarks
Invoke the IntegratedLibraryManager method to fetch the IIntegratedLibraryManager interface.
Methods
| Method | Returns | Description |
|---|---|---|
| AddRemoveLibraries | void | This method invokes the Available Libraries dialog with a list of installed libraries if any and their activated, path and type values. |
| AvailableLibraryCount | int | The AvailableLibraryCount method determines the number of available libraries. |
| AvailableLibraryPath | string | The AvailableLibraryPath method retrieves the file path of the indexed library in the Available Libraries dialog. |
| AvailableLibraryType | TLibraryType | The AvailableLibraryType method determines what type the indexed library is. |
| BrowseComponent | bool | |
| BrowseDatafileEntity | bool | |
| BrowseDatafileEntityInDatafile | bool | |
| BrowseForComponent | void | This BrowseForDataFile method invokes the Browse for Components dialog. |
| BrowseForComponentAndPart | void | This BrowseForComponentAndPart method invokes the Browse for Parts dialog. |
| BrowseForComponentAndPartCheckDBLibs | void | |
| BrowseForComponentCheckDBLibs | void | |
| BrowseForDatafile | void | This BrowseForDataFile method invokes the Browse Libraries dialog. |
| BrowseModel | bool | |
| BrowseSymbol | bool | |
| BrowseSymbolRevision | bool | |
| ComponentHasModelOfType | bool | This method checks if this indexed component from the specified library has this model type. |
| CreateIntegratedLibrary | void | This CreateIntegratedLibrary method creates an integrated library from a project into the specified path and, depending on a flag, installs it in the Available Libraries dialog. |
| ExtractSources | void | This ExtractSources method extracts the source files such as PCBLIB and PCB3DLIb files from the Integrated Library specified by its ALibraryPath parameter. |
| ExtractSourcesToDatabaseLib | string | |
| ExtractSourcesToDesignItemManager | string | |
| ExtractSourcesToPath | void | This ExtractSources method extracts the source files such as PCBLIB and PCB3DLIb files to the destination path (ADestinationPath parameter) from the Integrated Library specified by its ALibraryPath p… |
| FindComponentDesignItemDeviceSheet | bool | |
| FindComponentDisplayPath | string | |
| FindComponentLibraryPath | string | The method returns the path of the library the component is part of. |
| FindComponentSymbol | bool | The method validates whether if the component symbol is available or not dependent on the supplied parameters. |
| FindDatafileEntityDatafilePath | string | The method returns the path of the library the component is part of. |
| FindDatafileEntityLibraryPath | string | |
| FindDatafileEntitySourceDatafilePath | string | This method returns the path of the data file in library . |
| FindDatafileEntitySourceLibraryPath | string | |
| FindDatafileInStandardLibs | string | This method returns the path of the data file for the specified model in an integrated library. |
| FindDeviceSheetByFileName | bool | |
| FindLibraryInformation | bool | The method validates the existence of the library. |
| FindModelLibraryPath | string | The method returns the path of the library the model is part of. |
| GetAllParametersFromSourceLib | string | |
| GetAvailableDBLibDocAtPath | IDatabaseLibDocument | |
| GetCachedFullFilePathFromExplicitFileName | bool | |
| GetComponentCount | int | This method retrieves the count of components within the specified integrated library. |
| GetComponentDatafileLocation | string | This GetComponentDatafileLocation method obtains the location of the datafile for the component with the specified data file index, model name and its model type, component name and the full library. |
| GetComponentLocation | string | This GetComponentLocation returns the path of the specified component name within the specified library. |
| GetComponentLocationFromDatabase | string | |
| GetComponentName | string | This method retrieves the name for the indexed component within the specified integrated library. |
| GetComponentPlacementParameters | string | |
| GetDatabaseDatafileLocation | string | |
| GetDatabaseModelFullLibPath | string | |
| GetDatafileEntityCount | int | This method gets datafile entity count for the specified component and its indexed model in the specified library path. |
| GetDatafilePath | string | This method gets datafile path for the specified component, its indexed model and its indexed datafile in the specified library path. |
| GetFirstLibraryFullPathForLibRef | string | |
| GetLifeCycleState | string | |
| GetModel | IModel | |
| GetModelCount | int | This method retrieves the model count for the indexed component within the specified library. |
| GetModelName | string | This method retrieves the model name for the indexed component within the specified library. |
| GetModelType | IModelType | This method retrieves the model type for the indexed component within the specified library. |
| GetOrderedRevisionList | bool | |
| GetParameterCount | int | |
| GetParameterName | string | |
| GetParametersForDBComponent | string | |
| GetParameterValue | string | |
| GetSchLibPathForDBComponent | string | |
| GetSchLibRefForDBComponent | string | |
| GetWorkingFileNameFromCacheFileName | string | |
| InstalledLibraryCount | int | This InstalledLibraryCount method reports the number of installed libraries as in the Installed tab of the Available Libraries dialog in Altium Designer. |
| InstalledLibraryPath | string | This InstalledLibraryPath method retrieves the path of the indexed installed library in Altium Designer. |
| InstallLibrary | void | This method installs the library (full path) in the Available Libraries dialog (in the Installed page) in Altium Designer. |
| IsParameterDatabaseKey | bool | |
| MakeCurrentProject | void | This method makes the current library in the Libraries panel based on the project. |
| ModelCount | int | This ModelCount method returns the number of models of the same type associated with the component within the specified library. |
| ModelName | string | This ModelName method returns the name of the model type associated with the component within a specified library. |
| ParseDatabaseKeys | string | |
| PlaceLibraryComponent | bool | This method places a component from a specified library with Library Reference and Parameters that describe/define this component. |
| UninstallLibrary | void | This method removes the specified library (full path) in the Available Libraries dialog (in the Installed page) in Altium Designer |
| UpdateCachedFileIfNecessary | void |
AddRemoveLibraries
This method invokes the Available Libraries dialog with a list of installed libraries if any and their activated, path and type values.
void AddRemoveLibraries();
Returns: nothing (void)
Example: Open the dialog that adds and removes libraries.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
intMan.AddRemoveLibraries();
AvailableLibraryCount
The AvailableLibraryCount method determines the number of available libraries. Note, the first installed library in the Available Libraries dialog is indexed zero (0).
int AvailableLibraryCount();
Returns: int
An available library is one of the libraries on the Installed, Project and Search path tabs within the Available Libraries dialog.
An installed library appears in the Installed tab of the Available Libraries dialog.
Example: Show the number of available libraries.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
DXP.Utils.ShowMessage(intMan.AvailableLibraryCount().ToString());
See also: IIntegratedLibraryManager.AvailableLibraryPath, IIntegratedLibraryManager.AvailableLibraryType
AvailableLibraryPath
The AvailableLibraryPath method retrieves the file path of the indexed library in the Available Libraries dialog. Note, the first installed library in the Available Libraries dialog is indexed zero (0).
string AvailableLibraryPath(int argLibraryIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryIndex | int | value |
Returns: string
An available library is one of the libraries on the Installed, Project and Search path tabs within the Available Libraries dialog.
An installed library appears in the Installed tab of the Available Libraries dialog.
Example: Show the path of the first available library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
DXP.Utils.ShowMessage(intMan.AvailableLibraryPath(0));
Examples: Extension_TestCS
AvailableLibraryType
The AvailableLibraryType method determines what type the indexed library is. Note, the first installed library in the Available Libraries dialog is indexed zero (0).
TLibraryType AvailableLibraryType(int argLibraryIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryIndex | int | value |
Returns: TLibraryType
Extension method of IIntegratedLibraryManagerHelper (using SCH;).
An available library is one of the libraries on the Installed, Project and Search path tabs within the Available Libraries dialog.
An installed library appears in the Installed tab of the Available Libraries dialog.
Example: Show the type of the first available library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
TLibraryType libType = intMan.AvailableLibraryType(0);
switch (libType)
{
case TLibraryType.eLibIntegrated: DXP.Utils.ShowMessage("Integrated"); break;
case TLibraryType.eLibSource: DXP.Utils.ShowMessage("Lib Source"); break;
case TLibraryType.eLibDatafile: DXP.Utils.ShowMessage("Lib data File"); break;
case TLibraryType.eLibDatabase: DXP.Utils.ShowMessage("Database"); break;
case TLibraryType.eLibNone: DXP.Utils.ShowMessage("None"); break;
case TLibraryType.eLibQuery: DXP.Utils.ShowMessage("Query"); break;
case TLibraryType.eLibDesignItems: DXP.Utils.ShowMessage("Design Items"); break;
}
See also: TLibraryType
BrowseComponent
No description yet.
bool BrowseComponent(TLibIdentifierKind argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDesignItemID, ref int argPartID, out string argSymbolReference, out string argSymbolLibraryPath, ref string argModelName, string argModelType, out string argModelLibraryPath);
bool BrowseComponent(int argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDesignItemID, ref int argPartID, out string argSymbolReference, out string argSymbolLibraryPath, ref string argModelName, string argModelType, out string argModelLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | ref |
argDesignItemID | string | ref |
argPartID | int | ref |
argSymbolReference | string | out |
argSymbolLibraryPath | string | out |
argModelName | string | ref |
argModelType | string | value |
argModelLibraryPath | string | out |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
BrowseDatafileEntity
No description yet.
bool BrowseDatafileEntity(TLibIdentifierKind argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDatafileEntityName, string argDatafileType, out string argDatafilePath);
bool BrowseDatafileEntity(int argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDatafileEntityName, string argDatafileType, out string argDatafilePath);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | ref |
argDatafileEntityName | string | ref |
argDatafileType | string | value |
argDatafilePath | string | out |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
BrowseDatafileEntityInDatafile
No description yet.
bool BrowseDatafileEntityInDatafile(TLibIdentifierKind argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDatafileEntityName, string argDatafileType, out string argDatafilePath, bool argUseIntAndDBLibrary);
bool BrowseDatafileEntityInDatafile(int argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDatafileEntityName, string argDatafileType, out string argDatafilePath, bool argUseIntAndDBLibrary);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | ref |
argDatafileEntityName | string | ref |
argDatafileType | string | value |
argDatafilePath | string | out |
argUseIntAndDBLibrary | bool | value |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
BrowseForComponent
This BrowseForDataFile method invokes the Browse for Components dialog.
void BrowseForComponent(ref string argLibReference, ref string argSCHLibraryPath, ref string argSelModelName, ref string argSelModelLib, ref string argLibPath, ref string argModelType);
| Parameter | Type | Passing |
|---|---|---|
argLibReference | string | ref |
argSCHLibraryPath | string | ref |
argSelModelName | string | ref |
argSelModelLib | string | ref |
argLibPath | string | ref |
argModelType | string | ref |
Returns: nothing (void)
BrowseForComponentAndPart
This BrowseForComponentAndPart method invokes the Browse for Parts dialog.
void BrowseForComponentAndPart(ref string argLibReference, ref string argSCHLibraryPath, ref string argSelModelName, ref string argSelModelLib, ref string argLibPath, ref string argModelType, ref int argPartID);
| Parameter | Type | Passing |
|---|---|---|
argLibReference | string | ref |
argSCHLibraryPath | string | ref |
argSelModelName | string | ref |
argSelModelLib | string | ref |
argLibPath | string | ref |
argModelType | string | ref |
argPartID | int | ref |
Returns: nothing (void)
BrowseForComponentAndPartCheckDBLibs
No description yet.
void BrowseForComponentAndPartCheckDBLibs(ref string argLibReference, ref string argSCHLibraryPath, ref string argSelModelName, ref string argSelModelLib, ref string argLibPath, ref string argModelType, ref string argDatabaseTableName, ref string argDatabaseKeys, ref int argPartID);
| Parameter | Type | Passing |
|---|---|---|
argLibReference | string | ref |
argSCHLibraryPath | string | ref |
argSelModelName | string | ref |
argSelModelLib | string | ref |
argLibPath | string | ref |
argModelType | string | ref |
argDatabaseTableName | string | ref |
argDatabaseKeys | string | ref |
argPartID | int | ref |
Returns: nothing (void)
BrowseForComponentCheckDBLibs
No description yet.
void BrowseForComponentCheckDBLibs(ref string argLibReference, ref string argSCHLibraryPath, ref string argSelModelName, ref string argSelModelLib, ref string argLibPath, ref string argModelType, ref string argDatabaseTable, ref string argDatabaseKeys);
| Parameter | Type | Passing |
|---|---|---|
argLibReference | string | ref |
argSCHLibraryPath | string | ref |
argSelModelName | string | ref |
argSelModelLib | string | ref |
argLibPath | string | ref |
argModelType | string | ref |
argDatabaseTable | string | ref |
argDatabaseKeys | string | ref |
Returns: nothing (void)
BrowseForDatafile
This BrowseForDataFile method invokes the Browse Libraries dialog.
void BrowseForDatafile(ref string argModelName, ref string argModelPath, ref string argLibPath, ref string argModelType, bool argForComponentInstance);
| Parameter | Type | Passing |
|---|---|---|
argModelName | string | ref |
argModelPath | string | ref |
argLibPath | string | ref |
argModelType | string | ref |
argForComponentInstance | bool | value |
Returns: nothing (void)
Example: Let the user browse for a footprint in an integrated library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
// Placeholders: the library and the footprint to start from.
string libraryPath = "<path of an .IntLib file>";
string modelType = "PCBLIB";
string aFootprintName = "<footprint name>";
intMan.BrowseForDatafile(ref aFootprintName, ref libraryPath, ref libraryPath, ref modelType, true);
BrowseModel
No description yet.
bool BrowseModel(TLibIdentifierKind argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDesignItemID, ref string argModelName, string argModelType, out string argModelLibraryPath);
bool BrowseModel(int argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDesignItemID, ref string argModelName, string argModelType, out string argModelLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | ref |
argDesignItemID | string | ref |
argModelName | string | ref |
argModelType | string | value |
argModelLibraryPath | string | out |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
BrowseSymbol
No description yet.
bool BrowseSymbol(TLibIdentifierKind argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDesignItemID, out string argSymbolReference, out string argSymbolLibraryPath);
bool BrowseSymbol(int argLibIdentifierKind, ref string argLibraryIdentifier, ref string argDesignItemID, out string argSymbolReference, out string argSymbolLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | ref |
argDesignItemID | string | ref |
argSymbolReference | string | out |
argSymbolLibraryPath | string | out |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
BrowseSymbolRevision
No description yet.
bool BrowseSymbolRevision(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, ref string argDesignItemID, out string argSymbolReference, out string argSymbolLibraryPath, out string argRevisionStatus);
bool BrowseSymbolRevision(int argLibIdentifierKind, string argLibraryIdentifier, ref string argDesignItemID, out string argSymbolReference, out string argSymbolLibraryPath, out string argRevisionStatus);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDesignItemID | string | ref |
argSymbolReference | string | out |
argSymbolLibraryPath | string | out |
argRevisionStatus | string | out |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
ComponentHasModelOfType
This method checks if this indexed component from the specified library has this model type. Model Types include:
bool ComponentHasModelOfType(string argLibraryPath, int argComponentIndex, string argModelType);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argModelType | string | value |
Returns: bool
PCBLIB
PCB3DLIB
SIM
SI
Example: Check whether the first component of a library has a footprint model.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
string libraryPath = "<library path>";
int componentIndex = 0;
bool status = intMan.ComponentHasModelOfType(libraryPath, componentIndex, "PCBLIB");
if (status)
DXP.Utils.ShowMessage("True");
else
DXP.Utils.ShowMessage("False");
CreateIntegratedLibrary
This CreateIntegratedLibrary method creates an integrated library from a project into the specified path and, depending on a flag, installs it in the Available Libraries dialog.
void CreateIntegratedLibrary(IProject argProject, string argnOutputPath, bool argInstall);
void CreateIntegratedLibrary(object argProject, string argnOutputPath, bool argInstall);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argProject | IProject | value | The project the integrated library is created from. |
argnOutputPath | string | value | The path the integrated library is created into. |
argInstall | bool | value | Determines whether the integrated library is installed in the Available Libraries dialog. |
Returns: nothing (void)
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
ExtractSources
This ExtractSources method extracts the source files such as PCBLIB and PCB3DLIb files from the Integrated Library specified by its ALibraryPath parameter.
void ExtractSources(string argLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
Returns: nothing (void)
Example: Extract the source libraries of every integrated library in a folder.
using System.IO;
using System.Linq;
using SCH;
IIntegratedLibraryManager integratedLibraryManager = EDP.Utils.LoadIntegratedLibraryManager();
if (integratedLibraryManager == null)
return;
// Placeholder: the folder that contains the .IntLib files.
string sourceFolder = "<folder containing IntLib files>";
if (Directory.Exists(sourceFolder))
{
string[] filesList = Directory.GetFiles(sourceFolder, "*.IntLib")
.Distinct(StringComparer.OrdinalIgnoreCase)
.OrderBy(f => f, StringComparer.OrdinalIgnoreCase)
.ToArray();
for (int i = 0; i < filesList.Length; i++)
integratedLibraryManager.ExtractSources(filesList[i]);
}
ExtractSourcesToDatabaseLib
No description yet.
string ExtractSourcesToDatabaseLib(string argLibraryPath, IDatabaseLibDocument argDatabaseLib, string argnAbsoluteOutputPath, string argRelativeOutputPath);
string ExtractSourcesToDatabaseLib(string argLibraryPath, object argDatabaseLib, string argnAbsoluteOutputPath, string argRelativeOutputPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argDatabaseLib | IDatabaseLibDocument | value |
argnAbsoluteOutputPath | string | value |
argRelativeOutputPath | string | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
ExtractSourcesToDesignItemManager
No description yet.
string ExtractSourcesToDesignItemManager(string argLibraryPath, string argDestinationPath, out string argParameters);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argDestinationPath | string | value |
argParameters | string | out |
Returns: string
ExtractSourcesToPath
This ExtractSources method extracts the source files such as PCBLIB and PCB3DLIb files to the destination path (ADestinationPath parameter) from the Integrated Library specified by its ALibraryPath parameter.
void ExtractSourcesToPath(string argLibraryPath, string argDestinationPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argDestinationPath | string | value |
Returns: nothing (void)
FindComponentDesignItemDeviceSheet
No description yet.
bool FindComponentDesignItemDeviceSheet(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argDeviceSheetPath);
bool FindComponentDesignItemDeviceSheet(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argDeviceSheetPath);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDesignItemID | string | value |
argDeviceSheetPath | string | out |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
FindComponentDisplayPath
No description yet.
string FindComponentDisplayPath(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
string FindComponentDisplayPath(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDesignItemID | string | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
FindComponentLibraryPath
The method returns the path of the library the component is part of.
string FindComponentLibraryPath(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
string FindComponentLibraryPath(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value | Denotes which type of library the component is from. |
argLibraryIdentifier | string | value | The library identifier string that the component is associated with. |
argDesignItemID | string | value | The symbol reference (library reference) of the component from a Schematic or Integrated Library, or a unique part number from a record within a table of a Database. |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
Example: List the component and model library paths of the components on the current schematic sheet.
using System.Collections.Generic;
using SCH;
IIntegratedLibraryManager integratedLibraryManager = EDP.Utils.LoadIntegratedLibraryManager();
ISch_Document currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (integratedLibraryManager == null || currentSheet == null)
return;
var modelsList = new List<string>();
ISch_Iterator componentIterator = currentSheet.SchIterator_Create();
componentIterator.AddFilter_ObjectSet(new SCH.TObjectSet { TObjectId.eSchComponent });
try
{
for (var component = componentIterator.FirstSchObject() as ISch_Component; component != null; component = componentIterator.NextSchObject() as ISch_Component)
{
// For each component found on the schematic, you can iterate for its implementations.
ISch_Iterator implementationIterator = component.SchIterator_Create();
implementationIterator.AddFilter_ObjectSet(new SCH.TObjectSet { TObjectId.eImplementation });
for (var schImplementation = implementationIterator.FirstSchObject() as ISch_Implementation; schImplementation != null; schImplementation = implementationIterator.NextSchObject() as ISch_Implementation)
{
if (schImplementation.GetState_UseComponentLibrary())
{
string componentPath = integratedLibraryManager.FindComponentLibraryPath(component.GetState_LibIdentifierKind(),
component.GetState_LibraryIdentifier(), component.GetState_DesignItemId());
string modelPath = integratedLibraryManager.FindModelLibraryPath(component.GetState_LibIdentifierKind(),
component.GetState_LibraryIdentifier(), component.GetState_DesignItemId(),
schImplementation.GetState_ModelName(), schImplementation.GetState_ModelType());
modelsList.Add(" The Component is in Integrated Library");
modelsList.Add(" Component path: " + componentPath);
modelsList.Add(" Model path: " + modelPath);
}
}
component.SchIterator_Destroy(ref implementationIterator);
}
}
finally
{
currentSheet.SchIterator_Destroy(ref componentIterator);
}
FindComponentSymbol
The method validates whether if the component symbol is available or not dependent on the supplied parameters.
bool FindComponentSymbol(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argSymbolLibraryPath, out string argSymbolReference);
bool FindComponentSymbol(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argSymbolLibraryPath, out string argSymbolReference);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value | Denotes which type of library the component is from. |
argLibraryIdentifier | string | value | The library identifier string that the component is associated with. |
argDesignItemID | string | value | The symbol reference (library reference) of the component from a Schematic or Integrated Library, or a unique part number from a record within a table of a Database. |
argSymbolLibraryPath | string | out | The library. |
argSymbolReference | string | out | The name of the component symbol. |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
Example: Find the symbol library and symbol of every component on the current schematic sheet.
using SCH;
IIntegratedLibraryManager integratedLibraryManager = EDP.Utils.LoadIntegratedLibraryManager();
ISch_Document currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (integratedLibraryManager == null || currentSheet == null)
return;
ISch_Iterator iterator = currentSheet.SchIterator_Create();
iterator.AddFilter_ObjectSet(new SCH.TObjectSet { TObjectId.eSchComponent });
try
{
for (var aPart = iterator.FirstSchObject() as ISch_Component; aPart != null; aPart = iterator.NextSchObject() as ISch_Component)
{
string symbolLibraryPath, symbolReference;
string newSymbolLibraryPath, newSymbolReference;
if (integratedLibraryManager.FindComponentSymbol(aPart.GetState_LibIdentifierKind(), aPart.GetState_LibraryIdentifier(),
aPart.GetState_DesignItemId(), out symbolLibraryPath, out symbolReference))
{
newSymbolLibraryPath = symbolLibraryPath;
newSymbolReference = symbolReference;
}
else
{
newSymbolLibraryPath = "";
newSymbolReference = "";
}
}
}
finally
{
currentSheet.SchIterator_Destroy(ref iterator);
}
FindDatafileEntityDatafilePath
The method returns the path of the library the component is part of.
string FindDatafileEntityDatafilePath(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType, bool argUseIntAndDBLibrary);
string FindDatafileEntityDatafilePath(int argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType, bool argUseIntAndDBLibrary);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value | Denotes which type of library the component is from. |
argLibraryIdentifier | string | value | The library identifier string that the component is associated with. |
argDatafileEntityName | string | value | |
argDatafileType | string | value | |
argUseIntAndDBLibrary | bool | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
Example: List the library and data file paths of the simulation models of the components on the current schematic sheet.
using System.Collections.Generic;
using SCH;
IIntegratedLibraryManager integratedLibraryManager = EDP.Utils.LoadIntegratedLibraryManager();
ISch_Document currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument();
if (integratedLibraryManager == null || currentSheet == null)
return;
var modelsList = new List<string>();
ISch_Iterator componentIterator = currentSheet.SchIterator_Create();
componentIterator.AddFilter_ObjectSet(new SCH.TObjectSet { TObjectId.eSchComponent });
try
{
for (var component = componentIterator.FirstSchObject() as ISch_Component; component != null; component = componentIterator.NextSchObject() as ISch_Component)
{
// For each component found on the schematic, you can iterate for its implementations.
ISch_Iterator implementationIterator = component.SchIterator_Create();
implementationIterator.AddFilter_ObjectSet(new SCH.TObjectSet { TObjectId.eImplementation });
for (var schImplementation = implementationIterator.FirstSchObject() as ISch_Implementation; schImplementation != null; schImplementation = implementationIterator.NextSchObject() as ISch_Implementation)
{
if (schImplementation.GetState_DatafileLinkCount() > 0)
{
// Assumption: use the first data file link for the simulation model since we
// normally only use one sim model per component.
ISch_ModelDatafileLink modelDataFile = schImplementation.GetState_SchDatafileLink(0);
string sourceLibraryPath = integratedLibraryManager.FindDatafileEntitySourceLibraryPath(modelDataFile.GetState_LibIdentifierKind(),
modelDataFile.GetState_LibraryIdentifier(), modelDataFile.GetState_EntityName(), modelDataFile.GetState_FileKind());
string libraryPath = integratedLibraryManager.FindDatafileEntityLibraryPath(modelDataFile.GetState_LibIdentifierKind(),
modelDataFile.GetState_LibraryIdentifier(), modelDataFile.GetState_EntityName(), modelDataFile.GetState_FileKind());
string sourceDatafilePath = integratedLibraryManager.FindDatafileEntitySourceDatafilePath(modelDataFile.GetState_LibIdentifierKind(),
modelDataFile.GetState_LibraryIdentifier(), modelDataFile.GetState_EntityName(), modelDataFile.GetState_FileKind(), true);
string datafilePath = integratedLibraryManager.FindDatafileEntityDatafilePath(modelDataFile.GetState_LibIdentifierKind(),
modelDataFile.GetState_LibraryIdentifier(), modelDataFile.GetState_EntityName(), modelDataFile.GetState_FileKind(), true);
modelsList.Add(" Model : DatafilelinkCount > 0");
modelsList.Add(" Source Library path: " + sourceLibraryPath);
modelsList.Add(" Library path: " + libraryPath);
modelsList.Add(" Source datafile path: " + sourceDatafilePath);
modelsList.Add(" Datafile path: " + datafilePath);
}
}
component.SchIterator_Destroy(ref implementationIterator);
}
}
finally
{
currentSheet.SchIterator_Destroy(ref componentIterator);
}
FindDatafileEntityLibraryPath
No description yet.
string FindDatafileEntityLibraryPath(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType);
string FindDatafileEntityLibraryPath(int argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDatafileEntityName | string | value |
argDatafileType | string | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
FindDatafileEntitySourceDatafilePath
This method returns the path of the data file in library .
string FindDatafileEntitySourceDatafilePath(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType, bool argUseIntAndDBLibrary);
string FindDatafileEntitySourceDatafilePath(int argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType, bool argUseIntAndDBLibrary);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDatafileEntityName | string | value |
argDatafileType | string | value |
argUseIntAndDBLibrary | bool | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
FindDatafileEntitySourceLibraryPath
No description yet.
string FindDatafileEntitySourceLibraryPath(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType);
string FindDatafileEntitySourceLibraryPath(int argLibIdentifierKind, string argLibraryIdentifier, string argDatafileEntityName, string argDatafileType);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDatafileEntityName | string | value |
argDatafileType | string | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
FindDatafileInStandardLibs
This method returns the path of the data file for the specified model in an integrated library.
string FindDatafileInStandardLibs(string argDatafileEntityName, string argDatafileType, string argDatafileLocation, bool argForComponentInstance, ref string argFoundInLibraryPath);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argDatafileEntityName | string | value | The footprint name, 3D model name, Sim name or SI name. Required. |
argDatafileType | string | value | Denotes the model type represented by the datafiletype (PCB, PCB3DLIB, SIM, SI). |
argDatafileLocation | string | value | Optional. |
argForComponentInstance | bool | value | True if it is in an integrated library, false otherwise. |
argFoundInLibraryPath | string | ref | Returns the location of the data file if all the supplied parameters are valid. |
Returns: string
Example: Install a footprint library and find a footprint in the installed libraries.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
intMan.InstallLibrary("<path of a .PcbLib file>");
bool inIntLib = false;
string foundLocation = "";
intMan.FindDatafileInStandardLibs("<footprint name>", "PCBLIB", "", inIntLib, ref foundLocation);
DXP.Utils.ShowMessage(foundLocation);
Examples: Extension_PartComment
FindDeviceSheetByFileName
No description yet.
bool FindDeviceSheetByFileName(string argFileName, out string argDesignItemID, out string argLibraryIdentifier);
| Parameter | Type | Passing |
|---|---|---|
argFileName | string | value |
argDesignItemID | string | out |
argLibraryIdentifier | string | out |
Returns: bool
FindLibraryInformation
The method validates the existence of the library.
bool FindLibraryInformation(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argLibraryPath, out string argDBTableName);
bool FindLibraryInformation(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argLibraryPath, out string argDBTableName);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value | Denotes which type of library the component is from. |
argLibraryIdentifier | string | value | The library identifier string that the component is associated with. Normally a path to a library. |
argDesignItemID | string | value | The symbol reference (library reference) of the component from a Schematic or Integrated Library, or a unique part number from a record within a table of a Database. |
argLibraryPath | string | out | Returned for the valid design item of a component. |
argDBTableName | string | out | Returned if a component is from a database. |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
Example: Find the path of the library that holds a component.
using SCH;
IIntegratedLibraryManager integratedLibraryManager = EDP.Utils.LoadIntegratedLibraryManager();
if (integratedLibraryManager == null)
return;
// Placeholders: the library identifier and the design item ID of the component.
string aLibraryIdentifier = "<library identifier>";
string aDesignItemID = "<design item ID>";
string path, dbTableName;
if (!integratedLibraryManager.FindLibraryInformation(EDP.TLibIdentifierKind.eLibIdentifierKind_NameWithType, aLibraryIdentifier,
aDesignItemID, out path, out dbTableName))
path = "";
FindModelLibraryPath
The method returns the path of the library the model is part of.
string FindModelLibraryPath(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, string argModelName, string argModelType);
string FindModelLibraryPath(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, string argModelName, string argModelType);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value | Denotes which type of library the component is from. |
argLibraryIdentifier | string | value | The library identifier string that the component is associated with. |
argDesignItemID | string | value | The symbol reference (library reference) of the component from a Schematic or Integrated Library, or a unique part number from a record within a table of a Database. |
argModelName | string | value | The name of the implementation (model) linked to this component. |
argModelType | string | value | The model type of the implementation (model) linked to this component. |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
GetAllParametersFromSourceLib
No description yet.
string GetAllParametersFromSourceLib(string argLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
Returns: string
GetAvailableDBLibDocAtPath
No description yet.
IDatabaseLibDocument GetAvailableDBLibDocAtPath(string argLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
Returns: IDatabaseLibDocument
Extension method of IIntegratedLibraryManagerHelper (using SCH;).
GetCachedFullFilePathFromExplicitFileName
No description yet.
bool GetCachedFullFilePathFromExplicitFileName(string argRepositoryURL, string argExplicitFileName, ref string argCachedFileName);
| Parameter | Type | Passing |
|---|---|---|
argRepositoryURL | string | value |
argExplicitFileName | string | value |
argCachedFileName | string | ref |
Returns: bool
GetComponentCount
This method retrieves the count of components within the specified integrated library.
int GetComponentCount(string argLibraryPath);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLibraryPath | string | value | Specifies the integrated library. |
Returns: int
Example: Show the number of components in the second available library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
DXP.Utils.ShowMessage(intMan.GetComponentCount(intMan.AvailableLibraryPath(1)).ToString());
Examples: Ciiva, Extension_IntegratedLibraryManager
GetComponentDatafileLocation
This GetComponentDatafileLocation method obtains the location of the datafile for the component with the specified data file index, model name and its model type, component name and the full library. The result is returned by the method itself or in an output parameter.
string GetComponentDatafileLocation(int argDatafileIndex, string argModelName, string argModelType, string argComponentName, string argComponentLibraryName, ref string argFoundInLibraryPath);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argDatafileIndex | int | value | The data file index. |
argModelName | string | value | The model name. |
argModelType | string | value | The model type. |
argComponentName | string | value | The component name. |
argComponentLibraryName | string | value | The full library. |
argFoundInLibraryPath | string | ref | Returns the result, the location of the datafile. |
Returns: string
Example: Show where the footprint of a component of an integrated library is found.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
// Placeholders: the library, the component and its footprint.
string libraryPath = "<path of an .IntLib file>";
string componentName = "<component name>";
string footprintName = "<footprint name>";
string foundLocation = "";
intMan.GetComponentDatafileLocation(0, footprintName, "PCBLIB", componentName, libraryPath, ref foundLocation);
DXP.Utils.ShowMessage(foundLocation + " for Component Datafile location");
Examples: Extension_PartComment
GetComponentLocation
This GetComponentLocation returns the path of the specified component name within the specified library.
string GetComponentLocation(string argLibraryName, string argComponentName, ref string argFoundInLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryName | string | value |
argComponentName | string | value |
argFoundInLibraryPath | string | ref |
Returns: string
Example: Show where a component of an integrated library is found.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
// Placeholders: the library file name and the component name.
string libraryName = "<library file name>.IntLib";
string componentName = "<component name>";
string foundLocation = "";
intMan.GetComponentLocation(libraryName, componentName, ref foundLocation);
DXP.Utils.ShowMessage(foundLocation
+ "\r"
+ "for "
+ componentName);
Examples: Ciiva, Extension_PartComment
GetComponentLocationFromDatabase
No description yet.
string GetComponentLocationFromDatabase(string argLibraryName, string argTableName, string argDatabaseKeys, ref string argFoundInLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryName | string | value |
argTableName | string | value |
argDatabaseKeys | string | value |
argFoundInLibraryPath | string | ref |
Returns: string
GetComponentName
This method retrieves the name for the indexed component within the specified integrated library. Remember first index is 0.
string GetComponentName(string argLibraryPath, int argComponentIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
Returns: string
Example: List the names of the components in the second available library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
string s = "";
string availLibPath = intMan.AvailableLibraryPath(1);
int componentCount = intMan.GetComponentCount(intMan.AvailableLibraryPath(1));
for (int i = 0; i < componentCount; i++)
s = s + " " + intMan.GetComponentName(availLibPath, i);
DXP.Utils.ShowMessage(s);
Examples: Ciiva, Extension_IntegratedLibraryManager
GetComponentPlacementParameters
No description yet.
string GetComponentPlacementParameters(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
string GetComponentPlacementParameters(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDesignItemID | string | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
GetDatabaseDatafileLocation
No description yet.
string GetDatabaseDatafileLocation(int argDatafileIndex, string argModelName, string argModelType, string argComponentKeys, string argTableName, string argDatabaseLibraryName, ref string argFoundInLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argDatafileIndex | int | value |
argModelName | string | value |
argModelType | string | value |
argComponentKeys | string | value |
argTableName | string | value |
argDatabaseLibraryName | string | value |
argFoundInLibraryPath | string | ref |
Returns: string
GetDatabaseModelFullLibPath
No description yet.
string GetDatabaseModelFullLibPath(string argDatabaseLibraryPath, string argLibPath, string argModelName, string argModelType);
| Parameter | Type | Passing |
|---|---|---|
argDatabaseLibraryPath | string | value |
argLibPath | string | value |
argModelName | string | value |
argModelType | string | value |
Returns: string
GetDatafileEntityCount
This method gets datafile entity count for the specified component and its indexed model in the specified library path. Remember first index is 0.
int GetDatafileEntityCount(string argLibraryPath, int argComponentIndex, int argModelIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argModelIndex | int | value |
Returns: int
GetDatafilePath
This method gets datafile path for the specified component, its indexed model and its indexed datafile in the specified library path. Remember first index is 0.
string GetDatafilePath(string argLibraryPath, int argComponentIndex, int argModelIndex, int argDatafileIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argModelIndex | int | value |
argDatafileIndex | int | value |
Returns: string
GetFirstLibraryFullPathForLibRef
No description yet.
string GetFirstLibraryFullPathForLibRef(string argDirectory, string argLibRef, string argExtension);
| Parameter | Type | Passing |
|---|---|---|
argDirectory | string | value |
argLibRef | string | value |
argExtension | string | value |
Returns: string
GetLifeCycleState
No description yet.
string GetLifeCycleState(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
string GetLifeCycleState(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDesignItemID | string | value |
Returns: string
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
GetModel
No description yet.
IModel GetModel(string argLibraryPath, int argComponentIndex, int argModelIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argModelIndex | int | value |
Returns: IModel
Extension method of IIntegratedLibraryManagerHelper (using SCH;).
GetModelCount
This method retrieves the model count for the indexed component within the specified library. The first indexed component is 0.
int GetModelCount(string argLibraryPath, int argComponentIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
Returns: int
Example: Show the number of models of the first component in a library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
string libraryPath = "<path of an .IntLib file>";
DXP.Utils.ShowMessage(intMan.GetModelCount(libraryPath, 0).ToString());
See also: IIntegratedLibraryManager.GetModelName, IIntegratedLibraryManager.GetModelType
GetModelName
This method retrieves the model name for the indexed component within the specified library. The first indexed component is 0.
string GetModelName(string argLibraryPath, int argComponentIndex, int argModelIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argModelIndex | int | value |
Returns: string
Example: Show the name of the first model of the first component in a library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
string libraryPath = "<path of an .IntLib file>";
DXP.Utils.ShowMessage(intMan.GetModelName(libraryPath, 0, 0));
See also: IIntegratedLibraryManager.GetModelCount, IIntegratedLibraryManager.GetModelType
GetModelType
This method retrieves the model type for the indexed component within the specified library. The first indexed component is 0.
IModelType GetModelType(string argLibraryPath, int argComponentIndex, int argModelIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argModelIndex | int | value |
Returns: IModelType
Extension method of IIntegratedLibraryManagerHelper (using SCH;).
See also: IModelType, IIntegratedLibraryManager.GetModelName, IIntegratedLibraryManager.GetModelCount
GetOrderedRevisionList
No description yet.
bool GetOrderedRevisionList(TLibIdentifierKind argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argCommaTextList);
bool GetOrderedRevisionList(int argLibIdentifierKind, string argLibraryIdentifier, string argDesignItemID, out string argCommaTextList);
| Parameter | Type | Passing |
|---|---|---|
argLibIdentifierKind | TLibIdentifierKind | value |
argLibraryIdentifier | string | value |
argDesignItemID | string | value |
argCommaTextList | string | out |
Returns: bool
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
GetParameterCount
No description yet.
int GetParameterCount(string argLibraryPath, int argComponentIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
Returns: int
Examples: Ciiva, Extension_IntegratedLibraryManager
GetParameterName
No description yet.
string GetParameterName(string argLibraryPath, int argComponentIndex, int argParameterIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argParameterIndex | int | value |
Returns: string
Examples: Ciiva, Extension_IntegratedLibraryManager
GetParametersForDBComponent
No description yet.
string GetParametersForDBComponent(string argLibraryName, string argTableName, string argDatabaseKeys);
| Parameter | Type | Passing |
|---|---|---|
argLibraryName | string | value |
argTableName | string | value |
argDatabaseKeys | string | value |
Returns: string
GetParameterValue
No description yet.
string GetParameterValue(string argLibraryPath, int argComponentIndex, int argParameterIndex);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argComponentIndex | int | value |
argParameterIndex | int | value |
Returns: string
Examples: Ciiva, Extension_IntegratedLibraryManager
GetSchLibPathForDBComponent
No description yet.
string GetSchLibPathForDBComponent(string argLibraryPath, string argTableName, string argDatabaseKeys);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argTableName | string | value |
argDatabaseKeys | string | value |
Returns: string
GetSchLibRefForDBComponent
No description yet.
string GetSchLibRefForDBComponent(string argLibraryPath, string argTableName, string argDatabaseKeys);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argTableName | string | value |
argDatabaseKeys | string | value |
Returns: string
GetWorkingFileNameFromCacheFileName
No description yet.
string GetWorkingFileNameFromCacheFileName(string argCacheFileName);
| Parameter | Type | Passing |
|---|---|---|
argCacheFileName | string | value |
Returns: string
InstalledLibraryCount
This InstalledLibraryCount method reports the number of installed libraries as in the Installed tab of the Available Libraries dialog in Altium Designer.
int InstalledLibraryCount();
Returns: int
See also: IIntegratedLibraryManager.InstalledLibraryPath, IIntegratedLibraryManager.AvailableLibraryPath, IIntegratedLibraryManager.AvailableLibraryCount
Examples: Extension_IntegratedLibraryManager
InstalledLibraryPath
This InstalledLibraryPath method retrieves the path of the indexed installed library in Altium Designer. An installed library appears in the installed libraries list box in the Installed tab of the Available Libraries dialog.
string InstalledLibraryPath(int argnIndex);
| Parameter | Type | Passing |
|---|---|---|
argnIndex | int | value |
Returns: string
Example: Uninstall every installed library and keep a list of their paths.
using System.Collections.Generic;
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
var originalInstalledList = new List<string>();
for (int i = 0; i < intMan.InstalledLibraryCount(); i++)
originalInstalledList.Add(intMan.InstalledLibraryPath(i));
// Uninstall after collecting the paths: uninstalling changes the indexes of the remaining libraries.
foreach (string path in originalInstalledList)
intMan.UninstallLibrary(path);
// do what you want with the originalInstalledList
Examples: Extension_IntegratedLibraryManager
InstallLibrary
This method installs the library (full path) in the Available Libraries dialog (in the Installed page) in Altium Designer.
void InstallLibrary(string argLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
Returns: nothing (void)
Example: Install an integrated library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
intMan.InstallLibrary("<path of an .IntLib file>");
IsParameterDatabaseKey
No description yet.
bool IsParameterDatabaseKey(string argLibraryPath, string argDatabaseTableName, string argParameterName);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
argDatabaseTableName | string | value |
argParameterName | string | value |
Returns: bool
MakeCurrentProject
This method makes the current library in the Libraries panel based on the project.
void MakeCurrentProject(IProject argProject);
void MakeCurrentProject(object argProject);
| Parameter | Type | Passing |
|---|---|---|
argProject | IProject | value |
Returns: nothing (void)
The first overload is an extension method of IIntegratedLibraryManagerHelper (using SCH;) with typed parameters; the second is declared by the interface.
Example: Compile the focused library package into an integrated library and make it the current project.
using System.IO;
using DXP;
using EDP;
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
var wsm = DXP.GlobalVars.Client.GetDXPWorkspace() as EDP.IWorkspace;
if (wsm == null)
return;
IProject project = wsm.DM_FocusedProject();
if (project == null)
return;
string libPath = Path.ChangeExtension(project.DM_ProjectFullPath(), ".INTLIB");
intMan.CreateIntegratedLibrary(project, libPath, true);
intMan.MakeCurrentProject(project);
ModelCount
This ModelCount method returns the number of models of the same type associated with the component within the specified library.
int ModelCount(string argComponentName, string argComponentLibraryName, string argModelType);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argComponentName | string | value | The name of the component. |
argComponentLibraryName | string | value | The full path of the library the component is from. |
argModelType | string | value | The model type whose models are counted. |
Returns: int
ModelName
This ModelName method returns the name of the model type associated with the component within a specified library.
string ModelName(string argComponentName, string argComponentLibraryName, string argModelType, int argnIndex);
| Parameter | Type | Passing |
|---|---|---|
argComponentName | string | value |
argComponentLibraryName | string | value |
argModelType | string | value |
argnIndex | int | value |
Returns: string
Example: List the footprint models of a component in an integrated library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
// Placeholders: the library and the component.
string libraryPath = "<path of an .IntLib file>";
string componentName = "<component name>";
int modelCount = intMan.ModelCount(componentName, libraryPath, "PCBLIB");
DXP.Utils.ShowMessage(componentName + "'s ModelCount : " + modelCount);
string s = "";
for (int i = 0; i < modelCount; i++)
s = s + "\r" + intMan.ModelName(componentName, libraryPath, "PCBLIB", i);
DXP.Utils.ShowMessage(s);
ParseDatabaseKeys
No description yet.
string ParseDatabaseKeys(string argKeys, string argDelimiter);
| Parameter | Type | Passing |
|---|---|---|
argKeys | string | value |
argDelimiter | string | value |
Returns: string
PlaceLibraryComponent
This method places a component from a specified library with Library Reference and Parameters that describe/define this component.
bool PlaceLibraryComponent(string argLibReference, string argLibraryPath, string argParameters);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argLibReference | string | value | Defines the component. For example 'Res2'. |
argLibraryPath | string | value | The path to the library that the component is from. For example 'Miscellaneous Devices.IntLib'. |
argParameters | string | value | The parameters needed for the component to be able to be placed on the schematic sheet. For example 'ModelType=SIM|ModelParameterName0=Value|ModelParameterValue0=1K|Orientation=1|Location.X=10000000|Location.Y=20000000'. Normally you will need Location.X and Location.Y parameters at the least to be able to place this component on the schematic sheet. |
Returns: bool
Example: Place a resistor from an integrated library on the current schematic sheet.
using SCH;
ISch_ServerInterface schServer = SCH.GlobalVars.SchServer;
if (schServer == null)
return;
if (schServer.GetCurrentSchDocument() == null)
return;
IIntegratedLibraryManager integratedLibraryManager = EDP.Utils.LoadIntegratedLibraryManager();
if (integratedLibraryManager == null)
return;
// Integrated Library object model is used to place a
// component from the library onto the schematic sheet.
integratedLibraryManager.PlaceLibraryComponent(
"Res2",
"Miscellaneous Devices.IntLib",
"ModelType=SIM|ModelParameterName0=Value|" +
"ModelParameterValue0=1K|Orientation=1|Location.X=10000000|Location.Y=20000000");
// Refresh screen
schServer.GetCurrentSchDocument().GraphicallyInvalidate();
UninstallLibrary
This method removes the specified library (full path) in the Available Libraries dialog (in the Installed page) in Altium Designer
void UninstallLibrary(string argLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argLibraryPath | string | value |
Returns: nothing (void)
Example: Uninstall an integrated library.
using SCH;
IIntegratedLibraryManager intMan = EDP.Utils.LoadIntegratedLibraryManager();
if (intMan == null)
return;
intMan.UninstallLibrary("<path of an .IntLib file>");
See also: IIntegratedLibraryManager.InstallLibrary
UpdateCachedFileIfNecessary
No description yet.
void UpdateCachedFileIfNecessary(string argCachedLibraryPath);
| Parameter | Type | Passing |
|---|---|---|
argCachedLibraryPath | string | value |
Returns: nothing (void)
Returned by
Utils.LoadIntegratedLibraryManager
Examples
Used in the SDK examples: Ciiva, Extension_IntegratedLibraryManager, Extension_PartComment, Extension_TestCS.