Para sólo calcular ciertos casos de carga, combinaciones de carga o combinaciones de resultados, justo como el comando "Para calcular...." (ver figura 01), puede usar el método "CalculateBarch" de la interfaz ICalculation. Al transferir datos, el método espera un campo con el tipo de carga. La carga incluye el número de la carga, y el tipo (p. ej. combinación de carga):
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 calculationv 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 iModel.GetApplication.UnlockLicense
End Sub