Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Nailboard Class / PlaceOuterDimension Method
First control point.
Second control points.
Position of the dimension number (text).
Example
In This Topic
    PlaceOuterDimension Method (Nailboard)
    In This Topic
    Place outer dimension between two selected control points. The control points must be members of the same wire harness.
    Syntax

    Parameters

    controlPoint1
    First control point.
    controlPoint2
    Second control points.
    position
    Position of the dimension number (text).

    Return Value

    Created occurrence of dimension.
    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
    // Init API.
    HpdApi api = HpdApi.GetInstance();
    
    // Open rpoject.
    Project project = api.OpenProject(@"d:\Projects\Demo\Demo.hxproj");
    
    // Open and select variant and nailboard.
    Variant variant = project.GetVariants()[0];
    Drawing2D drawing = variant.GetNailboards().FirstOrDefault(d => d.Name == "Nailboard_1");
    drawing.Open(false, false);
    
    try
    {
    	// Select control points.
    	BaseNbControlPoint cp1 = drawing.GetAllOccurrences().OfType<BaseNbControlPoint>().FirstOrDefault(c => c.Name == "cp_00112");
    	BaseNbControlPoint cp2 = drawing.GetAllOccurrences().OfType<BaseNbControlPoint>().FirstOrDefault(c => c.Name == "cp_00113");
    
    	// Create the dimension.
    	OccNbOuterDimension dimension = (drawing as Nailboard)?.PlaceOuterDimension(cp1, cp2, new Transform2DProperty<LengthProperty>("10mm", "10mm"));
    }
    catch (Exception e)
    {
    	// Handle the exception here.
    }
    
    // Save changes and close documents.
    drawing?.Save();
    drawing?.Close();
    project?.Close();
    api?.Close();
    See Also