New

12 January 2021

004903

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

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

Sub test_parameter()Dim iApp As RFEM5.ApplicationSet iApp = GetObject(, "RFEM5.Application")iApp.LockLicenseDim j As Integerj = iApp.GetModelCountDim iMod As RFEM5.IModel3Set iMod = iApp.GetActiveModelOn Error GoTo eDim formParams() As RFEM5.FormulaParameter'   get all formula parametersformParams = iMod.GetFormulaParameters'   delete all formula parametersiMod.CleanFormulaParameters'   set list of formula parametersReDim 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 = LengthUnitTypeformParams(UBound(formParams, 1)).Value = 0formParams(UBound(formParams, 1)).ValueType = DoubleTypeformParams(UBound(formParams, 1)).Comment = "new parameter"formParams(UBound(formParams, 1)).Formula = "b/3"formParams(UBound(formParams, 1)).RangeOfValues = "(3;5.5>"iMod.SetFormulaParameters formParamse:If Err.Number <> 0 Then MsgBox Err.description, vbCritical, Err.SourceiMod.GetApplication.UnlockLicenseSet iMod = NothingEnd 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.

### Write Comment...

• Views 96x

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

RFEM | Basics

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

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

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

RFEM | Steel | USA

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

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

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

RFEM | Structural dynamics and earthquake design according to EC 8

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

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

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

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

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

RFEM | Dynamics | USA

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

RFEM | Basics

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

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

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

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

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

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

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

RFEM | Structural dynamics and earthquake design according to EC 8

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

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

Dlubal Info Day Online | 15 December 2020

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

Length 37:35 min

Length 0:45 min

Length 0:51 min

Length 0:34 min

Length 0:41 min

Length 0:23 min

Length 0:54 min

Length 1:48 min

Length 0:46 min

Length 0:23 min

Length 0:48 min

Length 1:28 min