Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / PlaceWire Method / PlaceWire(LibWire,IPinBase,IPinBase,ApiLinkType) Method
Wire from library to be placed.
Initial pin from which the wire will lead.
End pin to which the wire will lead.
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
    PlaceWire(LibWire,IPinBase,IPinBase,ApiLinkType) Method
    In This Topic
    Place a wire. Wire can be placed between all kind of pins - standard pin on a connector, grouped pin on a connector, special component (splice, fuse, light, resistor, capacitor), virtual pin (concrete pin of a grouped pin on a connector or special component) and auxiliary pin.
    Syntax

    Parameters

    wire
    Wire from library to be placed.
    pin1
    Initial pin from which the wire will lead.
    pin2
    End pin to which the wire will lead.
    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

    Created wire occurrence.
    Exceptions
    ExceptionDescription
    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.
    This file is not opened.
    Example
    This example shows how to place a wire between an existing connector and an existing splice in the workspace.
    // Obtain the workspace beforehand.
    Workspace workspace = ...
    
    // Obtain wire from library.
    LibWire libWire = ...
    
    // Obtain connector and splice.
    OccWsConnector connector = ...
    OccWsSplice splice = ...
    
    // Connector has pins, obtain the first of them.
    IPinBase pin1 = connector.Children.First() as IPinBase;
    
    // Place wire between the specified connector's pin and splice.
    IOccWire wire = workspace.PlaceWire(libWire, pin1, splice);
    See Also