Harness proD API Help
EPLAN.Harness.API.Occurrences.Workspace Namespace / BaseWsLabel Class / KeyPoints Property
Example
In This Topic
    KeyPoints Property (BaseWsLabel)
    In This Topic
    Key points of the geometry of this occurrence.
    Syntax
    Exceptions
    ExceptionDescription
    Api is not in an initialized state. You can get current state from EPLAN.Harness.API.Studio.Status property. If API is uninitialized, you can initialize it by calling EPLAN.Harness.API.Studio.Init method. If API is in failed state, you can not resurrect it.
    The object is in invalid state. Obtain a new one.
    The exception that is thrown when you trying to access to already deleted occurrence.
    Remarks

    The position of a key point is relative to occurrence's Position.

    If this occurrence has no geometry, returns null. Check its EPLAN.Harness.API.Occurrences.BaseOccurrence.Childrens that may holds the geometry.

    Example
    This example shows how to calculate the absolute positions of occurrence key points.
    // Get the translatable occurrence from a designer.
    ITranslatable occ = GetOccurrence();
    
    // Positions of keypoints relative to occurrence's Position.
    IReadOnlyList<TransformProperty<LengthProperty>> keyPoints = occ.KeyPoints;
    
    // Position of the occurrence.
    TransformProperty<LengthProperty> occPosition = occ.Position;
    
    // Absolute positions of occurrence key points.
    List<TransformProperty<LengthProperty>> absolutePositions = keyPoints.Select(kp => occPosition + kp).ToList();
    See Also