Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / PlaceCavitySeal Method
The attached part which is placed.
Occurrence when the part is attached.
Determines if part's accessories will be placed with part. Mandatory, Optional, both types or None accessories can be placed. This enum has the Flags attribute. Default is mandatory accessories.
Example
In This Topic
    PlaceCavitySeal Method
    In This Topic
    Place a cavity seal.
    Syntax

    Parameters

    part
    The attached part which is placed.
    parentOccurrence
    Occurrence when the part is attached.
    linkType
    Determines if part's accessories will be placed with part. Mandatory, Optional, both types or None accessories can be placed. This enum has the Flags attribute. Default is mandatory accessories.

    Return Value

    Placed occurrence.
    Exceptions
    ExceptionDescription
    This file is not opened.
    Api is not in an initialized state. You can get current state from EPLAN.Harness.API.HpdApi.Status property. If API is uninitialized, you can initialize it by calling EPLAN.Harness.API.HpdApi.Init method. If API is in failed state, you can not resurrect it.
    The object is in invalid state. Obtain a new one.
    Thrown when the type of part can not be placed by the method or the part cannot be place to the occurrence.
    Thrown when placing this part failed.
    Example
    This example shows how to place a cavity seal part to workspace.
    /// Obtain workspace beforehand and open for writing.
    Workspace workspace = ...
    workspace.Open(false, false);
    
    // Obtain part from active library
    IEnumerable<BaseLibraryPart> parts = project.ActiveConnection.GetLibraryPartsByPartNumber("cavity seal");
    BaseLibraryPart part = parts.FirstOrDefault();
    
    // Obtain occurence from designer
    BaseOccurrence occurence = workspace.GetAllOccurrences<OccWsWire>().FirstOrDefault(occ => occ.Name.ToString() == "wire1");
    
    // Place a attached part to occurrence
    workspace.PlaceCavitySeal(part as LibCavitySeal, occurence);
    See Also