How can I only calculate specific load cases, load combinations, or result combinations by using a command with the COM interface?

Answer

In order to only calculate specific load cases, load combinations, or result combinations in the same way as the "To Calculate..." command (see Figure 01), you can use the CalculateBatch method of the ICalculation interface. For the transfer, the method expects a field with the load type of Loading. This Loading includes the number of the load, and the type (for example, a load combination):

Sub batch_test()
    
'   get interface from the opened model and lock the licence/program
    Dim iModel As RFEM5.IModel3
    Set iModel = GetObject(, "RFEM5.Model")
    iModel.GetApplication.LockLicense
    

On Error GoTo e
    
    '   get interface for calculation
    Dim iCalc As ICalculation2
    Set iCalc = iModel.GetCalculation
    
    '   create array with loading types
    Dim loadings(3) As Loading
    loadings(0).no = 1
    loadings(0).Type = LoadCaseType
    
    loadings(1).no = 4
    loadings(1).Type = LoadCaseType
    
    loadings(2).no = 4
    loadings(2).Type = LoadCombinationType
    
    '   calculate all loadings from the array at once
    iCalc.CalculateBatch loadings

e:  If Err.Number <> 0 Then MsgBox Err.description, , Err.Source
    
    Set iModelData = Nothing
    iModel.GetApplication.UnlockLicense
    Set iModel = Nothing

End Sub

Keywords

Batch To calculate COM Load combination Result combination Load case

Downloads

Links

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.

+49 9673 9203 0

info@dlubal.com

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
RSTAB Main Program
RSTAB 8.xx

Main Program

The structural engineering software for design of frame, beam and truss structures, performing linear and nonlinear calculations of internal forces, deformations, and support reactions

Price of First License
2,550.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
RSTAB Other
RS-COM 8.xx

Add-on Module

Programmable interface (API) based on the COM technology

Price of First License
580.00 USD