RFEdgeUse.CalcDirection



Your Ad Here

Description

Calculates the direction vector of the edge-use started from the start vertex and ended at the end vertex.

Syntax

Function RFEdgeUse.CalcDirection(pNormal As RFVector3) As RFErrorCode

The CalcDirection syntax has these parts:

Part Description
pNormal [OUTRFVector3 Required. Direction vector of the edge-use started from the start vertex and ended at the end vertex.

Sample

Dim rfErr As RapidForm.RFErrorCode
Dim shObj As RapidForm.RFShell
Dim fcObj As RapidForm.RFFace
Dim edObj As RapidForm.RFEdgeUse

    ' Assign RFShell, RFFace and RFEdgeUse interface objects
    Set shObj = RapidForm.Shell
    Set fcObj = RapidForm.Face
    Set edObj = RapidForm.EdgeUse
    
    ' Pick a face.
    Dim pickedID As RFEntityID
    rfErr = RapidForm.SelectTools.PickEntity(RF_PICK_FACE, 1, pickedID)
    fcObj.SetID (pickedID)
    
    Dim vtID(2) As RFEntityID
    
    ' Retrieves 3 vertices of the face.
    rfErr = fcObj.GetVertices(vtID(0), vtID(1), vtID(2))
    
    ' Identify an edge use by using the first two vertices.
    rfErr = edObj.SetID(vtID(0), vtID(1))
    
    ' Calculate the direction
    Dim edDir As RFVector3
    rfErr = edObj.CalcDirection(edDir)

Return to Rapidform Index


Your Ad Here