0x
004869
2020-12-14

通过 COM 接口读出截面的结果

如何通过COM接口读出截面的结果?


回复:

像所有其他结果一样,截面结果可以通过模型 3 → 导航器 2 → 导航器 IResults2 读取。 Die Schnittstelle zu den Ergebnissen bietet die Funktion GetResultant, welche unter Angabe der Schnittnummer und der Art der Ergebnisverteilung dann die Struktur ResultantForce zurückgibt. Diese Struktur beinhaltet unter anderem die Kräfte und Momente jeweils als Vektor:

Sub GetResultantSection()
    Dim iApp As RFEM5.Application
    Dim iModel As RFEM5.model
    Set iModel = GetObject(, "RFEM5.Model")

    On Error GoTo e

    '   get interface from model
    Set iApp = iModel.GetApplication
    iApp.LockLicense

    '   get interface from calculation
    Dim iCalc As RFEM5.ICalculation2
    Set iCalc = iModel.GetCalculation

    '   get interface from results from loadcase 1
    Dim iRes As RFEM5.IResults2
    Set iRes = iCalc.GetResultsInFeNodes(LoadCaseType, 1)

    '   get Resultant
    Dim section_resultant As ResultantForce
    section_resultant = iRes.GetResultant(1, AtNo, ConstantDistributionOnElements)

e:
If Err.Number <> 0 Then
    MsgBox Err.Number & " " & Err.description
End If

If Not iApp Is Nothing Then
    iApp.UnlockLicense
End If

End Sub

作者

Thomas在客户支持部门处理与软件相关的技术咨询。他能够可靠地熟悉不同主题,并制定合适的解决方案。

链接
下载


;