How can I create a result beam by using the COM interface?


First, a result beam is created as in the case of a normal member:

    Dim model As RFEM5.model
    Set model = GetObject(, "RFEM5.Model")

    On Error GoTo e

    Dim data As IModelData
    Set data = model.GetModelData

    Dim members(0) As RFEM5.Member
    members(0).No = 3
    members(0).LineNo = 12
    members(0).Type = ResultBeamType
    members(0).StartCrossSectionNo = 1
    members(0).EndCrossSectionNo = 1
    members(0).Comment = "result beam 1"

    data.SetMembers members

Then, it is necessary to take the IMember interface from the corresponding member, and use the GetExtraData method to get the interface to IResultMember. Now, this interface can be used to read or write the ResultMember data. Please note that the Prepare-/Finishmodification block is required when writing:

    Dim iMem As IMember
    Set iMem = data.GetMember(3, AtNo)
    Dim iRMem As IResultBeam
    Set iRMem = iMem.GetExtraData
    Dim RMem As ResultBeam
    RMem = iRMem.GetData
    RMem.IncludeSurfaces = "1"
    RMem.IncludeSolids = "all"
    RMem.Integrate = WithinCuboidGeneral
    Dim params(0 To 3) As Double
    RMem.Parameters = params
    RMem.Parameters(0) = 0.5
    RMem.Parameters(1) = 0.5
    RMem.Parameters(2) = 0.1
    RMem.Parameters(3) = 0.1
    iRMem.SetData RMem

The completed EXCEL macro and the corresponding test file are attached.


COM Result beam ResultMember


Contact us

Did you find your question?
If not, contact us via our free e-mail, chat, or forum support, or send us your question via the online form.

(267) 702-2815

RFEM Main Program
RFEM 5.xx

Main Program

Structural engineering software for finite element analysis (FEA) of planar and spatial structural systems consisting of plates, walls, shells, members (beams), solids and contact elements

Price of First License
3,540.00 USD
RFEM Other
RF-COM 5.xx

Add-on Module

Programmable interface (API) based on the COM technology

Price of First License
580.00 USD