Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / MergeControlPoints Method
Control point which will be moved and merged.
Destination control point which will stay in place.
Example
In This Topic
    MergeControlPoints Method
    In This Topic
    Merge control point with leading parts, clips or special electrical components.
    Syntax
    public void MergeControlPoints( 
       IControlPoint mergedPoint,
       IControlPoint destinationPoint
    )

    Parameters

    mergedPoint
    Control point which will be moved and merged.
    destinationPoint
    Destination control point which will stay in place.
    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.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    Argument is null.
    Remarks

    Leading part or grommet never moves, even when it is set as mergedPoint.

    Clip, special electrical component or inline ribbon pin always survives this command, even when it is set as mergedPoint.

    Example
    This example shows how to merge two control points.
    // Get and open a designer.
    Project project = api.OpenProject(@"c:\Projects\Demo\Demo.hxproj");
    Variant variant = project.GetVariants()[0];
    Designer designer = variant.GetWorkspaces().FirstOrDefault(d => d.Name == "Workspace_1");
    designer.Open(false, false);
    					
    // Select the control points to merge
    IControlPoint mergedPoint = designer.GetAllOccurrences<IControlPoint>().First(p => p.Name == "ControlPoint1");
    IControlPoint destinationPoint = designer.GetAllOccurrences<IControlPoint>().First(p => p.Name == "ControlPoint2");
    
    try
    {
    	designer.MergeControlPoints(mergedPoint, destinationPoint);
    	
    	// Control points are merged into the destination control point (except of few exceptions - see remarks).
    }
    catch (Exceptions.ArgumentException ex)
    {
    	// One of these points is not suitable for merging. See the exception message (ex.Message).
    }
    See Also