Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / AutoPlaceAttachedParts Method
Settings for automatic placing of attached parts.
Example
In This Topic
    AutoPlaceAttachedParts Method
    In This Topic
    Automatically add, remove or delete redundant attached parts.
    Syntax

    Parameters

    autoAttachPartsSettings
    Settings for automatic placing of attached parts.

    Return Value

    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.
    You can not perform this action on a document opened as read only.
    The exception that is thrown when the project has no active library.
    Example
    This example shows how to automatically add wire terminals to pins.
    // Open Workspace or Workdesk.
    Designer designer = ...
    designer.Open(false, false);
    
    // Specify what you want to do.
    AutoAttachPartsSettings settings = new AutoAttachPartsSettings(AutoPlaceAttachedPartsAction.AddObjects)
    {
    	AutoPlaceWireTerminalsOnPins = true
    };
    
    IEnumerable<AutoAttachedPartResult> autoAttachedPartResults = designer.AutoPlaceAttachedParts(settings);
    See Also