Hi @hbilla. I understand that you want some code that will create a custom iProperty, but we can not create custom iProperties that have multiple values. We can only create UserParameters that are multi-value. Even when that UserParameter is set to export, which exposes it as a custom iProperty with the same name and same value, the resulting custom iProperty only has the one value (the current visible value of the parameter). However, if you just want the code example to contain a list of possible values, and show that list to the user, so that they can select one value from it to set as the custom iProperty's value, then that is certainly possible. Just need to clarify what you want with as much detail as possible, because code needs to be extremely specific to make it work the way we want it to.
Edit: Below is an example of how we can create a custom iProperty, and let the user select a value for it from a list containing multiple possible values.
'get current document
Dim oDoc As Inventor.Document = ThisDoc.Document
'specify name of custom iProperty
Dim sPropertyName As String = "Custom Property 1"
'define list of possible values to choose from
Dim oPossibleValues As New List(Of String)
oPossibleValues.Add("Possible Value 1")
oPossibleValues.Add("Possible Value 2")
oPossibleValues.Add("Possible Value 3")
oPossibleValues.Add("Possible Value 4")
'prompt user to choose one from the list
Dim sChoice As String = InputListBox("CHOOSE ONE", oPossibleValues, "", "Title", "List Name")
'if they did not choose one, were done, exit rule
If sChoice = "" Then Return 'nothing chosen, so exit rule
'get the PropertySet for custom properties
Dim oCProps As Inventor.PropertySet = oDoc.PropertySets.Item(4)
'create variable for the custom iProperty object
Dim oCProp As Inventor.Property = Nothing
Try
'try to find existing property
oCProp = oCProps.Item(sPropertyName)
'set its value, if found
oCProp.Value = sChoice
Catch
'it did not exist, so create it, and set value at same time
oCProp = oCProps.Add(sChoice, sPropertyName)
End Try
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)