464x
002341
2021-02-22

[EN] FAQ 004951 | How can I use the COM interface to read out the global or local deformations...

Question:
How can I use the COM interface to read out the global or local deformations of members?

Answer:
The deformations of members can be read out using the "GetMemberDeformations()" function, for example. This function expects a number, the type of counting method for members (member number/number in the list), and which coordinate system should be used. You can select whether the local axis system, the principal axis system, or the global coordinate system is used:

Sub test_results_member_axis()

Dim iApp As RFEM5.Application
Set iApp = GetObject(, "RFEM5.Application")

iApp.LockLicense

Dim iMod As RFEM5.IModel3
Set iMod = iApp.GetActiveModel

On Error GoTo e

'get interface for calculation
Dim iCalc As RFEM5.ICalculation2
Set iCalc = iMod.GetCalculation

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

'get deformations in local coordinate system
Dim memDefs_L() As RFEM5.MemberDeformations
memDefs_L = iRes.GetMemberDeformations(1, AtNo, LocalMemberAxes)

'get deformations in global coordinate system
Dim memDefs_G() As RFEM5.MemberDeformations
memDefs_G = iRes.GetMemberDeformations(1, AtNo, GlobalAxes)

'get deformations in principal coordinate system
Dim memDefs_P() As RFEM5.MemberDeformations
memDefs_P = iRes.GetMemberDeformations(1, AtNo, LocalPrincipalAxes)

e:

If Err.Number 0 Then MsgBox Err.description, vbCritical, Err.Source

iMod.GetApplication.UnlockLicense
Set iMod = Nothing

End Sub

The small program reads out the local deformations (memDefs_L) in the member axes and the principal axes (memDefs_P) and the global deformations in the member axes (memDefs_G).



;