27 April 2020


Thomas Günthel




How can I create a section via the COM interface?


In principle, a section is an element, such as a member, and is also created in the same way. First, the interface to the objects is required. For a member, this would be IModelData, and for sections, it would be ISections. This interface can be found in IModel3:

Sub test_section()
'   get interface from the opened model and lock the licence/program
    Dim iModel As RFEM5.IModel3
    Set iModel = GetObject(, "RFEM5.Model")
On Error GoTo E
    Dim iSecs As RFEM5.ISections
    Set iSecs = iModel.GetSections()

All sections created previously are deleted first, and then two new sections are created.
The first section should be a solid section with a visible sectional area (see Figure 01). The data are entered in a similar way as in RFEM. As a type, "SectionOnSectionalArea" is selected, the corner points of the section are set by using "EdgePoint," and a "Vector" defines the direction of the section:

   '   first delete all sections
    iSecs.DeleteObjects ("All")
    '   set section on solid
    Dim sec As RFEM5.Section
    sec.EdgePointA.X = 2
    sec.EdgePointA.Y = 5
    sec.EdgePointA.Z = 0
    sec.EdgePointB.X = 2
    sec.EdgePointB.Y = 8
    sec.EdgePointB.Z = 0 = 1
    sec.Name = "solid section"
    sec.Plane = GlobalPlaneInPositiveX
    sec.ShowValuesInIsolines = False
    sec.Type = SectionOnSolidSectionLine
    sec.ObjectList = "1"
    iSecs.SetSection sec

As already known from other elements, the new section is finally transferred in a Prepare-/FinishModification block. As the second section, a surface section is to be created (see Figure 02). For this, it is necessary to use the "SectionViaSurfacePlane" type. In addition to the vector of the section direction, you have to select the display plane of the results for the surface section. In the following example, the xy plane is selected by setting "GlobalPlaneInPositiveX."

'   set section on surface
    sec.EdgePointA.X = 2
    sec.EdgePointA.Y = 0
    sec.EdgePointA.Z = 0
    sec.EdgePointB.X = 2
    sec.EdgePointB.Y = 3
    sec.EdgePointB.Z = 0 = 2
    sec.Name = "surface section"
    sec.Plane = GlobalPlaneInPositiveX
    sec.ShowValuesInIsolines = True
    sec.Type = SectionViaSurfacePlane
    sec.ObjectList = "1"
    sec.Vector.X = 0
    sec.Vector.Y = 0
    sec.Vector.Z = 1
    iSecs.SetSection sec

It is also possible to get the results of a section by using the separate method "GetResultsInSection" of the "IResults2" interface. In the following, the shear forces on the surface section are obtained. The distribution of the internal forces is set to "Continuous within Surfaces" by means of "ContinuousDistributionWithinObjects":

 '   get results
    Dim iCalc As ICalculation2
    Set iCalc = iModel.GetCalculation
    Dim iRes As IResults2
    Set iRes = iCalc.GetResultsInFeNodes(LoadCaseType, 1)
    Dim secRes() As RFEM5.SectionResult
    secRes = iRes.GetResultsInSection(2, AtNo,
      ShearForceVy,ContinuousDistributionWithinObjects, False)

Under Downloads, you can find the Excel macro and the test file to comprehend the program.


Section COM ISection


Contact us

Did you find your question?
If not, contact us via our free e-mail, chat, or forum support, or send us your question via the online form.

+49 9673 9203 0

RFEM Main Program
RFEM 5.xx

Main Program

Structural engineering software for finite element analysis (FEA) of planar and spatial structural systems consisting of plates, walls, shells, members (beams), solids and contact elements

Price of First License
3,540.00 USD
RFEM Other
RF-COM 5.xx

Add-on Module

Programmable interface (API) based on the COM technology

Price of First License
580.00 USD