RFUserInterface.AddShellToProjectTree



Your Ad Here

Description

Adds a specified shell to the project tree.

Syntax

Function RFUserInterface.AddShellToProjectTree(shellID As RFEntityID) As RFErrorCode

The AddShellToProjectTree syntax has these parts:

Part Description
shellID [INRFEntityID Required. Shell's RFEntityID to add.

Remarks

Sample

Dim rfErr As RFErrorCode
Dim mdObj As RapidForm.RFModel
Dim shObj As RapidForm.RFShell

    Set mdObj = RapidForm.Model
    Set shObj = RapidForm.Shell
    
    Dim shID As RFEntityID
    
    ' Add a blank sell.
    shID = mdObj.AddShell(RF_GENERIC_SHELL, "Simple shell")
    
    ' Register the shell in the GUI database.
    rfErr = RapidForm.UserInterface.AddShellToProjectTree(shID)
    
    rfErr = shObj.SetID(shID)
    
    ' Add three vertices in the shell.
    Dim vtID(2) As RFEntityID
    rfErr = shObj.AddVertex(0, 0, 0, vtID(0))
    rfErr = shObj.AddVertex(10, 0, 0, vtID(1))
    rfErr = shObj.AddVertex(0, 10, 0, vtID(2))
    
    ' Add a face composed by the three vertices.
    Dim fcID As RFEntityID
    rfErr = shObj.AddFace(vtID(0), vtID(1), vtID(2), False, fcID)
    
    ' Update the GUI database and redraw the scene.
    rfErr = RapidForm.Document.RegenShell(shID)
    RapidForm.Document.RedrawScene

Return to Rapidform Index


Your Ad Here