RFVertex.EnumAdjacentVertices



Your Ad Here

Description

Collects entity's ID of adjacent vertices in an RFEntityID array.

Syntax

Function RFVertex.EnumAdjacentVertices(pVertexIDs As RFEntityID, pVertexCount As Long) As RFErrorCode

The EnumAdjacentVertices syntax has these parts:

Part Description
pVertexIDs [OUTRFEntityID Required. The first element of an RFEntityID array to store entity ID's of adjacent vertices.
pVertexCount [IN, OUTLong Required. The number of adjacent vertices stored in pVertexIDs.


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)
    
    ' Collects adjacent vertices
    Dim pAdjVts() As RFEntityID
    Dim nAdjVts As Long
    
    rfErr = vtObj.GetAdjacentVerticesCount(nAdjVts)
    
    ' Allocate the memory space of the pAdjVts array as the amount of nAdjVts
    ReDim pAdjVts(nAdjVts)
    
    ' Pass the first element of the pAdjVts array.
    rfErr = vtObj.EnumAdjacentVertices(pAdjVts(0), nAdjVts)
    
   ' Finally release the allocated memory space for the pAdjVts array when it is no longer necessary.
    Erase pAdjVts

Return to Rapidform Index


Your Ad Here