Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Walliguy
in reply to: k_ponomarenko

Hey there.

 

Looking at your code it looks likes in your try you are verifying "Diameter_of_the_intake_pipe" user parameter exists. If it doesn't (catch) then you want to create a new multivalue list user parameter.

 

In the AddByExpression method I believe you are just passing a single item in the list "List.Item(3)" 

 

This is the pattern I took:

    Try
        Dim userParameter As UserParameter
        userParameter = userParameters.Item("STD_YES")
    Catch
        Dim UserParameter As UserParameter = userParameters.AddByValue("STD_YES", "No", "String")
        MultiValue.SetList("STD_YES", "Yes")
        UserParameter.IsKey = True
    End Try

Hope this helps,

Chris