How can I edit the list of parameters by using the COM interface?

Answer

The parameters of a model can be modified by using the IModel interface (as of IModel3):

Sub test_parameter()

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

iApp.LockLicense

Dim j As Integer
j = iApp.GetModelCount

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

On Error GoTo e

Dim formParams() As RFEM5.FormulaParameter

'   get all formula parameters
formParams = iMod.GetFormulaParameters

'   delete all formula parameters
iMod.CleanFormulaParameters

'   set list of formula parameters
ReDim Preserve formParams(0 To UBound(formParams, 1) + 1)
formParams(UBound(formParams, 1)).Name = "p"
formParams(UBound(formParams, 1)).Unit = "m"
formParams(UBound(formParams, 1)).UnitType = LengthUnitType
formParams(UBound(formParams, 1)).Value = 0
formParams(UBound(formParams, 1)).ValueType = DoubleType
formParams(UBound(formParams, 1)).Comment = "new parameter"
formParams(UBound(formParams, 1)).Formula = "b/3"
formParams(UBound(formParams, 1)).RangeOfValues = "(3;5.5>"

iMod.SetFormulaParameters formParams

e:

If Err.Number <> 0 Then MsgBox Err.description, vbCritical, Err.Source
iMod.GetApplication.UnlockLicense
Set iMod = Nothing

End Sub


It is only possible to read out all parameters by using the GetFormulaParameters() function. The modified or new parameters can then be transferred again as a list with the SetFormulaParameters() function. Thus, no individual parameters can be read out or written.

It should be noted that the "Value" related to its type (ValueTyp) and its unit (Unit) must be within the defined limits (RangeOfValues), otherwise an error message appears. If the value is calculated, as in the example, it is irrelevant and the value calculated with the formula (Formula) must be within the limits, if the limits are defined.


Keywords

Parameters Parameterization Parameter List FormulaParameter

Downloads

Links

Write Comment...

Write Comment...

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

info@dlubal.com

Online Training | English

RFEM | Basics

Online Training 29 January 2021 8:30 AM - 12:30 PM CET

Online Training | English

RFEM for Students | USA

Online Training 3 February 2021 1:00 PM - 4:00 PM EST

The Most Common User Errors With RFEM and RSTAB

The Most Common User Errors With RFEM and RSTAB

Webinar 4 February 2021 2:00 PM - 3:00 PM CET

Online Training | English

RFEM | Steel | USA

Online Training 16 February 2021 9:00 AM - 12:00 PM EST

Online Training | English

Eurocode 2 | Concrete structures according to DIN EN 1992-1-1

Online Training 19 February 2021 8:30 AM - 12:30 PM CET

Online Training | English

RFEM | Structural dynamics and earthquake design according to EC 8

Online Training 24 February 2021 8:30 AM - 12:30 PM CET

Online Training | English

Eurocode 5 | Timber structures according to EN 1995-1-1

Online Training 17 March 2021 8:30 AM - 12:30 PM CET

Online Training | English

Eurocode 3 | Steel structures according to DIN EN 1993-1-1

Online Training 18 March 2021 8:30 AM - 12:30 PM CET

Online Training | English

RFEM | Dynamics | USA

Online Training 23 March 2021 1:00 PM - 4:00 PM EST

Online Training | English

RFEM | Basics

Online Training 23 April 2021 8:30 AM - 12:30 PM

Online Training | English

Eurocode 3 | Steel structures according to DIN EN 1993-1-1

Online Training 6 May 2021 8:30 AM - 12:30 PM

Online Training | English

Eurocode 2 | Concrete structures according to DIN EN 1992-1-1

Online Training 11 May 2021 8:30 AM - 12:30 PM

Online Training | English

Eurocode 5 | Timber structures according to DIN EN 1995-1-1

Online Training 20 May 2021 8:30 AM - 12:30 PM

Online Training | English

RFEM | Structural dynamics and earthquake design according to EC 8

Online Training 2 June 2021 8:30 AM - 12:30 PM

ADM 2020 Member Design in RFEM

ADM 2020 Member Design in RFEM

Webinar 19 January 2021 2:00 PM - 3:00 PM EST

Dlubal Info Day

Dlubal Info Day Online | 15 December 2020

Webinar 15 December 2020 9:00 AM - 4:00 PM CET

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
RSTAB Main Program
RSTAB 8.xx

Main Program

The structural engineering software for design of frame, beam and truss structures, performing linear and nonlinear calculations of internal forces, deformations, and support reactions

Price of First License
2,550.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
RSTAB Other
RS-COM 8.xx

Add-on Module

Programmable interface (API) based on the COM technology

Price of First License
580.00 USD