Eyeshot 9.0 WinForms API Reference
FindClosestVertex(Point,Double,Int32) Method

WinForms Assembly > devDept.Eyeshot Namespace > ViewportLayout Class > FindClosestVertex Method : FindClosestVertex(Point,Double,Int32) Method
Mouse position (zero on top)
Limit the search to points at this distance in pixels from mouse cursor position
The closest vertex index
Looks for the model vertex whose 2D screen projection is closer to the mouse cursor.
Syntax
'Declaration
 
Public Overloads Function FindClosestVertex( _
   ByVal mousePos As Point, _
   ByVal maxDistance As Double, _
   ByRef closestIndex As Integer _
) As Integer
public int FindClosestVertex( 
   Point mousePos,
   double maxDistance,
   out int closestIndex
)

Parameters

mousePos
Mouse position (zero on top)
maxDistance
Limit the search to points at this distance in pixels from mouse cursor position
closestIndex
The closest vertex index

Return Value

The entity index if the closest vertex is nearer than maxDistance, -1 otherwise.
Remarks
The returned entity index refers to the Entities if there is no current BlockReference, else it refers to the Block.Entities of the Block referred by the EntityList.CurrentBlockReference. Also, the closestIndex point is in the coordinate space of the EntityList.CurrentBlockReference so, if there is a current BlockReference, to get the 3D world coordinates of the closestIndex point you need to transform it by the devDept.Eyeshot.Entities.BlockReference.AccumulatedParentsTransform of the EntityList.CurrentBlockReference
See Also

Reference

ViewportLayout Class
ViewportLayout Members
Overload List
IsCloserVertex Method