Harness proD API Help
EPLAN.Harness.API.DataStructures.LibraryConnections Namespace / ActiveLibraryConnection Class / GetLibraryPartsByGuidVer Method
Desired part's GUID.
Desired part's version (optional). If not specified the latest (current) revision of all part versions is returned.
If true the revision part of the version number is ignored. Optional parameter. The default value is true. If false, the part with exactly the same version and revision is returned (always just one part). This parameter is ignored if version is not specified.
Example
In This Topic
    GetLibraryPartsByGuidVer Method
    In This Topic
    Get library parts specified by GUID with option to specify part's version.
    Syntax

    Parameters

    guid
    Desired part's GUID.
    version
    Desired part's version (optional). If not specified the latest (current) revision of all part versions is returned.
    ignoreRevision
    If true the revision part of the version number is ignored. Optional parameter. The default value is true. If false, the part with exactly the same version and revision is returned (always just one part). This parameter is ignored if version is not specified.

    Return Value

    Parts with desired GUID and version.
    Exceptions
    ExceptionDescription
    The exception that is thrown when the project has no active library.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    Example
    This example shows how to get parts from a connected library using GUID and version.
    // Open a project beforehand.
    Project project = ...
    
    // Part with specified GUID and version is unique (still returned as an array of one element).
    IEnumerable<BaseLibraryPart> partByGuidAndVersion = project.ActiveConnection.GetLibraryPartsByGuidVer("be4259d972cc42c7aabc8eb339e7a60f", version);
    
    // More parts with same GUID might be returned, they will have different versions.
    IEnumerable<BaseLibraryPart> partByGuid = project.ActiveConnection.GetLibraryPartsByGuidVer("be4259d972cc42c7aabc8eb339e7a60f");
    See Also