回复:
为了像命令“计算...”一样只计算特定的荷载工况、荷载组合或结果组合(见图 01),可以使用接口 ICalculation 的 CalculateBatch 方法。 Bei der Übergabe erwartet die Methode ein Feld mit der Belastung vom Typ Loading. Loading beinhaltet dabei die Nummer der Belastung und den Typ (z. B. Lastkombination):
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
常见问题和解答 (FAQ)