877x
005138
2021-11-26

Creating Member End Release with Diagram via COM Interface

How can I create a member end release with a "diagram" using the COM interface?


Answer:

In order to create a nonlinear element, such as a member end release with a diagram or failure, it is necessary to create the member end release first. If RFEM knows the member end release, it can be obtained using the IMemberEndRelease interface. This interface uses the methods GetData() and SetData(). Both methods are able to read out or write simple member end release data of the MemberEndRelease type as well as the nonlinearity data.

In the following example, the release is first activated for the x-direction in the member end release, then the WorkingDiagramType is set as the nonlinearity in the x-direction. After transferring these data to RFEM using the Prepare-Finish-Modification block, it creates the nonlinearity internally. To enter the data, the existing data are first obtained from the interface of the member end release using GetData().

After entering the data (NonlinearityDiagram), it is transferred again using SetData():


Sub SetNLDiagram()

Dim model As RFEM5.model
Set model = GetObject(, "RFEM5.Model")

On Error GoTo e

Dim iApp As RFEM5.Application
Set iApp = model.GetApplication

iApp.LockLicense
iApp.Show

Dim iModelData As RFEM5.iModelData
Set iModelData = model.GetModelData

'   modify member end release
'       set nonlinearity "Diagram" for x translation
Dim iMemHing As RFEM5.IMemberHinge
Set iMemHing = iModelData.GetMemberHinge(1, AtNo)

Dim memHing As RFEM5.MemberHinge
memHing = iMemHing.GetData()
memHing.TranslationalConstantX = 0
memHing.TranslationalNonlinearityX = WorkingDiagramType

' Set new data
iModelData.PrepareModification
iMemHing.SetData memHing
iModelData.FinishModification


'       create diagram
Dim tbl1() As Double
ReDim tbl1(1, 1)
tbl1(0, 0) = 0  '   u-x
tbl1(0, 1) = 0  '   P-x

tbl1(1, 0) = 0.02  '   u-x (mm)
tbl1(1, 1) = 2000  '   P-x (N)

Dim nldHing As RFEM5.NonlinearityDiagram
nldHing.ForceType = StiffnessDiagramForceType.NoneStiffnessForce
nldHing.PositiveZoneType = DiagramAfterLastStepType.TearingDiagramType
nldHing.PositiveZone = tbl1
nldHing.Symmetric = True

Dim iNldiag As RFEM5.INonlinearityDiagram
Set iNldiag = iMemHing.GetNonlinearity(AlongAxisX)

'       Set new data
iModelData.PrepareModification
iNldiag.SetData nldHing
iModelData.FinishModification


e:      If Err.Number <> 0 Then MsgBox Err.description, , Err.Source

model.GetApplication.UnlockLicense

End Sub


The procedure is similar for nodal supports and other nonlinearities.