Question:
How can I read out the resultant of a section via the COM interface?
Answer:
Just like all other results, the resultant of a section can be read out via IModel3 → ICalculation2 → IResults2. The interface to the results is provided by the GetResultant function, which then returns the ResultantForce structure when specifying the section number and type of result distribution. This structure includes, among other things, the forces and moments as vectors:
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