RFFace.SetColor



Your Ad Here

Description

Sets the color of the face to the specified value.

Syntax

Function RFFace.SetColor(pColor As RFColor) As RFErrorCode

The SetColor syntax has these parts:

Part Description
pColor [INRFColor Required. Color of the face.

Remarks

Sample

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

    ' Assign the RFFace and RFShell interface object
    Set fcObj = RapidForm.Face
    Set shObj = RapidForm.Shell
    ' Pick a face
    Dim pickedID As RFEntityID
    rfErr = RapidForm.SelectTools.PickEntity(RF_PICK_FACE, 1, pickedID)
    
    ' If an error happens, exit the subroutine.
    If rfErr <> RF_SUCCESS Then
        MsgBox RapidForm.Application.GetErrorMessage(rfErr)
        Exit Sub
    End If
    
    rfErr = fcObj.SetID(pickedID)
    
    Dim shID As RFEntityID
    rfErr = fcObj.GetShell(shID)
    
    ' Set the type of the shell to RF_COLOR_PER_TRIANGLE
    rfErr = shObj.SetID(shID)
    rfErr = shObj.SetMaterialType(RF_COLOR_PER_TRIANGLE)
    
    ' Define Red color
    Dim redCol As RFColor
    redCol.r = 255
    redCol.g = 0
    redCol.b = 0
    redCol.a = 255
    
    rfErr = fcObj.SetColor(redCol)

   ' Regenerate the display list of the shell.
    rfErr = RapidForm.Document.RegenShell(shID)

    ' Redraw the document scene.
    RapidForm.Document.RedrawScene

Return to Rapidform Index


Your Ad Here