Hi @jltw7PSW2. There are many ways to do something like this, so you will likely see many different code examples for the same, or very similar task here on this forum, if you do a search in this forum for it. But here is one possible example code for either creating a new multi-value UserParameter, with a text type value, or to update it if it already exists. This should work on a part, assembly, or drawing.
'get reference to current document
Dim oDoc As Document = ThisDoc.Document
'get access to its parameters - accessed differently in different document types
Dim oParams As Inventor.Parameters = Nothing
If (TypeOf oDoc Is PartDocument) OrElse (TypeOf oDoc Is AssemblyDocument) Then
oParams = oDoc.ComponentDefinition.Parameters
ElseIf TypeOf oDoc Is DrawingDocument Then
oParams = oDoc.Parameters
End If
If oParams Is Nothing Then Return 'exit rule if parameters not found
'get the UserParameters collection - this is where we can create a new one, if needed
Dim oUParams As UserParameters = oParams.UserParameters
'make sure the parameter exists before trying to set multiple values to it
Dim oUParam As UserParameter = Nothing
Try 'try to get the existing parameter, by its name
oUParam = oUParams.Item("TYPE_OF_DWG")
Catch 'what to do if that fails
oUParam = oUParams.AddByValue("TYPE_OF_DWG", "", UnitsTypeEnum.kTextUnits)
End Try
'now specify the multiple values you want to it to have
Dim oValues() As String = {"ASSEMBLY DETAILS", "CONTROL DETAILS", "STEEL DETAILS" }
'this one causes the document to update after the change
MultiValue.UpdateAfterChange = True
'this one says to set the 'first' value in the new list as the current value of the parameter
MultiValue.SetValueOptions(True, 0)
'now set those values to the parameter
MultiValue.SetList("TYPE_OF_DWG", oValues)
'this line sets this parameter as key
oUParam.IsKey = True
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Edit: I think I somehow thought that the last reply on the previous page (Message 20) was the newest one (instead of Message 23), and replied to that by mistake, before seeing that there was a second page of replies in this conversation. 🤔😋
Wesley Crihfield

(Not an Autodesk Employee)