Solid Edge Geometry Type Library
FacesByRay Property
Description
Returns a collection of faces that are intersected by the specified vector.
Property type
Read-only property
Syntax
Visual Basic
Public Property FacesByRay( _
   ByVal Xorigin As Double, _
   ByVal Yorigin As Double, _
   ByVal Zorigin As Double, _
   ByVal Xdir As Double, _
   ByVal Ydir As Double, _
   ByVal Zdir As Double _
) As Object
Parameters
Xorigin
Yorigin
Zorigin
Xdir
Ydir
Zdir
Remarks
The result of the FacesByRay property is a topology collection. This topology collection is a temporary collection and is overwritten the next time the Edges, Faces, or FacesByRay property is used.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFrameWork.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objBody As SolidEdgeGeometry.Body
    Dim objBFacesByRay As Object
    Const TESTFILE = "T:\vbtests\testcases\cube.par"
    ' Report errors
    Const PI = 3.14159265358979
    ' Create/get the application with specific settings
    On Error Resume Next
    Set objApp = GetObject(, "SolidEdge.Application")
    If Err Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
        Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    Call objDoc.Close
    ' opening the test case file
    Set objDoc = objApp.Documents.Open(TESTFILE)
    ' getting the body object of the model
    Set objBody = objDoc.Models(1).Body
    ' getting the collection object of faces intercepted by a ray from the Body object
    Set objBFacesByRay = objBody.FacesByRay(xOrigin:=0, yOrigin:=0, zorigin:=0, _
                                            xdir:=1, ydir:=0, zdir:=0)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objBody = Nothing
    Set objBFacesByRay = Nothing
End Sub
See Also

Body Object  | Body Members

Send comments on this topic.