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.ApplicationSet iApp = GetObject(, "RFEM5.Application")
iApp.LockLicense
Dim j As Integerj = iApp.GetModelCount
Dim iMod As RFEM5.IModel3Set iMod = iApp.GetActiveModel
On Error GoTo e
Dim 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 formParams
e:
If Err.Number <> 0 Then MsgBox Err.description, vbCritical, Err.SourceiMod.GetApplication.UnlockLicenseSet 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
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.
Recommended Events
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
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
Videos
Models to Download
Knowledge Base Articles

New
Measuring Distances and Angles
To determine the distance between two nodes or the angle between two objects without using the dimensioning function, you can also simply use the ‘Measure’ option on the ‘Tools’ menu. Here, you can also choose between various measure functions.
Screenshots
Product Features Articles

New
Structural Analysis Models for Download
Download numerous structural models (for example, RFEM, RSTAB, or RWIND files) to utilize them for training purposes or for your projects.
Frequently Asked Questions (FAQ)
- How can I use the "Connect Lines or Members" function via the COM interface?
- What are the StandardID and AnnexID of various National Annexes for the processing using the COM interface?
- Is it possible to create visibilities using the COM interface?
- How can I select objects via the COM interface?
- Where can I find the RF‑COM/RS‑COM add-on module?
- I get error messages when starting the COM examples of C#. What can I do?
- Can I define nonlinear support conditions via the COM interface?
- How can I open and close RFEM/RSTAB in the background via the COM interface?
- The *.dll and *.tlb files specific for COM were obviously not updated correctly, which caused problems. What can I do?
- How can I only calculate specific load cases, load combinations, or result combinations by using a command with the COM interface?