The stresses of a surface can be displayed via the COM interface. First, you need the interface for the model (IModel) and then the interface for the calculation (ICalculation2). Using this interface, you can get the interface for the results (IResults2):
Sub stresses_surfaces_example()Dim iApp As RFEM5.ApplicationDim iModel As RFEM5.modelSet iModel = GetObject(, "RFEM5.Model")
On Error GoTo E
If Not iModel Is Nothing Then ' 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 equivalent stresses Dim str_equ() As RFEM5.SurfaceEquivalentStresses str_equ = iRes.GetSurfaceEquivalentStresses(1, AtNo, VonMisesHypothesis) End If
E:If Err.Number <> 0 Then MsgBox Err.Number & " " & Err.descriptionEnd If
If Not iApp Is Nothing Then iApp.UnlockLicenseEnd If
The GetSurfaceEquivalentStresses function requires the specification of the calculation hypothesis. In this case, the results of the von Mises stress are displayed. Please note that the COM interface uses SI units so the stress is transferred in N/m².