RFVertex.Translate



Your Ad Here

Description

Translates the vertex along X, Y and Z axis for specified distances.

Syntax

Function RFVertex.Translate(x As Double, y As Double, z As Double) As RFErrorCode

The Translate syntax has these parts:

Part Description
x [INDouble Required. X axis translation distance.
y [INDouble Required. Y axis translation distance.
z [INDouble Required. Z axis translation distance.

Remarks

Sample

Dim rfErr As RapidForm.RFErrorCode
Dim vtObj As RapidForm.RFVertex

    ' Assign the RFVertex interface object.
    Set vtObj = RapidForm.Vertex
    
    ' Pick a vertex.
    Dim pickedID As RFEntityID
    rfErr = RapidForm.SelectTools.PickEntity(RF_PICK_VERTEX, 1, pickedID)
    
    ' If an error happens, exit the subroutine.
    If rfErr <> RF_SUCCESS Then
        MsgBox RapidForm.Application.GetErrorMessage(rfErr)
        Exit Sub
    End If
    
    rfErr = vtObj.SetID(pickedID)

  ' Retrieves the shell ID to which the vertex belongs
    Dim shID As RFEntityID
    rfErr = vtObj.GetShell(shID)

    ' Translate the vertex
    rfErr = vtObj.Translate(-10, 10, 10)
    
    ' Rotate the vertex
    Dim PI As Double
    
    PI = 3.141592
    rfErr = vtObj.Rotate(PI / 3, 0, 0)
    
    ' Scale the vertex
    rfErr = vtObj.Resize(2, 1, 1)
    
    ' Transform the vertex
    Dim trMat As RFTMatrix
    trMat.m(0, 0) = 1
    trMat.m(0, 1) = 1
    trMat.m(0, 2) = 1
    
    trMat.m(1, 0) = 1
    trMat.m(1, 1) = 1
    trMat.m(1, 2) = 1
    
    trMat.m(2, 0) = 1
    trMat.m(2, 1) = 1
    trMat.m(2, 2) = 1
    
    rfErr = vtObj.Transform(trMat)


    ' Regenerate the display list of the shell.
    RapidForm.Document.RegenShell shID
    
    ' Redraw the document scene.
    RapidForm.Document.RedrawScene

Return to Rapidform Index


Your Ad Here