Harness proD API Help
EPLAN.Harness.API.DataStructures.LibraryConnections Namespace / ActiveLibraryConnection Class / GetLibraryPartsByType Method
Desired part types.
Example
In This Topic
    GetLibraryPartsByType Method
    In This Topic
    Get all library parts of the given type(s).
    Syntax

    Parameters

    partTypes
    Desired part types.

    Return Value

    List of parts of the type(s).
    Exceptions
    ExceptionDescription
    The exception that is thrown when the project has no active library.
    Example
    This example shows how to get all parts of the desired type from a connected library.
    // Open a project beforehand...
    Project project = ...
    
    // Get all parts of the (two) desired types.
    IEnumerable<BaseLibraryPart> parts = project.ActiveConnection.GetLibraryPartsByType(new PartType[] { PartType.Connector, PartType.Terminal });
    See Also