When you need to add multiple parameters at one time, you will need to include a loop to process multiple items. Here is a very slightly altered version of the earlier rule I posted which includes a loop of those parameter names.
Dim oDoc As Document = ThisDoc.Document
If oDoc.IsModifiable = False Then Exit Sub
If ThisApplication.FileManager.IsInventorComponent(oDoc.FullFileName) = False Then Exit Sub
Dim oUParams As UserParameters = oDoc.ComponentDefinition.Parameters.UserParameters
Dim oUParam As UserParameter = Nothing
Dim oParamNames As New List(Of String) From {"Tube_diameter", "Tube_thickness", "Length_of_tube", "Inconel_thickness"}
For Each sParamName In oParamNames
Try
'Check to see if this Parameter already exists
oUParam = oUParams.Item(sParamName)
Catch
'Parameter doesn't exist, so create it
oUParam = oUParams.AddByExpression(sParamName, "1 mm", UnitsTypeEnum.kMillimeterLengthUnits)
End Try
Next
oDoc.Update
'oDoc.Save
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)