GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoToolLinking Class / PickNearestPort Method
a PointF in document coordinates
In This Topic
    PickNearestPort Method
    In This Topic
    Find the valid document port nearest to a given point.
    Syntax
    public virtual IGoPort PickNearestPort( 
       PointF dc
    )

    Parameters

    dc
    a PointF in document coordinates
    Remarks
    A nearby port (as determined by the distance between dc and the result of PortPoint) must be within the GoView.PortGravity distance for it to qualify, and it must be in a GoLayer that is visible. This uses the IsValidLink predicate, passing it the OriginalStartPort along with each port to be considered. The results of IsValidLink are cached in ValidPortsCache, for the cases where determining valid links is computationally expensive. This cache is valid only for the duration of this linking tool as the current tool; it is cleared each time this tool is stopped.
    See Also