Solid Edge Framework Type Library
Locate Method
‘X’ coordinate to query.
‘Y’ coordinate to query.
Currently not implemented. Please specify zero.
Returns derived top level model ‘X’ coordinate.
Returns derived top level model ‘Y’ coordinate.
Returns derived top level model ‘Z’ coordinate.
Description
Return the closest point at the specified screen location.
Syntax
Visual Basic
Public Sub Locate( _
   ByVal lPointX As Long, _
   ByVal lPointY As Long, _
   ByVal lRadius As Long, _
   ByRef pdHitPointX As Double, _
   ByRef pdHitPointY As Double, _
   ByRef pdHitPointZ As Double _
) 
Parameters
lPointX
‘X’ coordinate to query.
lPointY
‘Y’ coordinate to query.
lRadius
Currently not implemented. Please specify zero.
pdHitPointX
Returns derived top level model ‘X’ coordinate.
pdHitPointY
Returns derived top level model ‘Y’ coordinate.
pdHitPointZ
Returns derived top level model ‘Z’ coordinate.
Remarks
This method can be used to derive an XYZ coordinate from the depth buffer associated with a 3D graphic view. The lPointX and lPointY arguments define the GDI screen coordinates to query. The lRadius is currently not implemented. If a graphic object has been drawn at the screen position indicated, the pdHitPoint{X|Y|Z} return arguments will contain the derived top level model coordinate. If no object can be located, the return values are not modified. The current implementation only returns an error if there is a problem with the view – otherwise the caller can deposit initial values into the hit point arguments and check to see if they have been modified during the call.
Example
 Private Sub Locate_Click(sender As Object, e As EventArgs) Handles Locate.Click
    Dim objApplication As SolidEdgeFramework.Application = Nothing
    Dim objView As SolidEdgeFramework.View = Nothing
    Dim objCurWindow As SolidEdgeFramework.Window
    Dim objX, objY, objZ As Double
    Dim objNX, objNY, objNZ As Double
        
        Try
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objCurWindow = objApplication.ActiveWindow
            'Assigning values to variables
            objView = objCurWindow.View
            objX = 0
            objY = 0
            objZ = 0
            'objN{X|Y|Z} return arguments will contain the derived top level model coordinate. 
            objView.Locate(objX, objY, 0, objNX, objNY, objNZ)

            MsgBox("Result of Locate" + vbNewLine + objNX.ToString + " " + objNY.ToString + " " + objNZ.ToString)
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
End Sub
See Also

View Object  | View Members  | Solid Edge ST4 - What's New