914x
004181
2019-11-25

Creating Result Beam via COM Interface

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


Answer:

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

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

    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.PrepareModification
    data.SetMembers members
    data.FinishModification

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
    
    data.PrepareModification
    iRMem.SetData RMem
    data.FinishModification

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


Author

Mr. Günthel provides technical support for our customers.

Downloads


;