Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Nailboard Class / PlaceControlPoint Method
First control point
Second control poiint
Distance from 1st control point in direction to 2nd one.
Example
In This Topic
    PlaceControlPoint Method (Nailboard)
    In This Topic
    Place custom control point on control path (bundle, wire, cable). The custom point is placed between two control points on specified distance from 1st one. The control points must lay on the same control path and they must be neighbours.
    Syntax

    Parameters

    controlPoint1
    First control point
    controlPoint2
    Second control poiint
    distanceFromCp1
    Distance from 1st control point in direction to 2nd one.

    Return Value

    Created occurrence of custom control point.
    Exceptions
    ExceptionDescription
    Argument is null.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    The operation was not successful.
    Example
    The example shows how to place a custom control point in nailboard.
    // API is a singleton.
    HpdApi api = HpdApi.GetInstance();
    
    // Initialize API and load HpD.
    api.Init();
    
    // Open a project.
    Project project = api.OpenProject(@"d:\MyProject.hxproj");
    
    // Select a variant.
    Variant variant = project.GetVariants()[0];
    
    // Select and open a nailboard.
    Nailboard drawing = variant.GetNailboards().FirstOrDefault(d => d.Name == "WH_1");
    drawing.Open(false, false);
    
    // Select two control points.
    BaseNbControlPoint cp1 = drawing.GetAllOccurrences<BaseNbControlPoint>().FirstOrDefault(o => o.Name == "End point:3_");
    BaseNbControlPoint cp2 = drawing.GetAllOccurrences<BaseNbControlPoint>().FirstOrDefault(o => o.Name == "cp_00060");
    
    // Place and get the custom control point.
    OccNbCustomPoint cp = drawing.PlaceControlPoint(cp1, cp2, "50mm");
    
    // Save and close the project.
    project.Save();
    project.Close();
    
    // Close the API.
    api.Close();
    See Also