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

The code below should get you pointed in the right direction. It just adds multi-value Parameters and changing User Parameter. I hope this helps in some way.

 

SyntaxEditor Code Snippet

Imports  Inventor.UnitsTypeEnum


Dim oAssemblyDoc As Document
oAssemblyDoc = ThisDoc.Document

If oAssemblyDoc.DocumentType = kAssemblyDocumentObject Then

    Dim oAssemblyCompDef As AssemblyComponentDefinition
        oAssemblyCompDef = oAssemblyDoc.ComponentDefinition
        
Dim oParams As Parameters
        oParams=oAssemblyCompDef.Parameters
                
        Dim oUserParams As UserParameters
        oUserParams=oParams.UserParameters       
        
        Dim oAwesomeParameter As Parameter                     
                    Try
            otester = oUserParams.Item("PK_Extended_Item_Description")
            Catch
oInsulationType=oUserParams.AddByValue("PK_Extended_Item_Description", "General", kTextUnits) 
MultiValue.SetList("PK_Extended_Item_Description", "Manufacturing", "Purchasing", "General", "Customer Order", "Phantom")
            End Try
            End If

Parameter.Param("PK_Extended_Item_Description").ExposedAsProperty = False
Parameter.Param("PK_Extended_Item_Description").IsKey = False