Make my updated input message box results show in message

Make my updated input message box results show in message

tracey_prior8CZVC
Explorer Explorer
327 Views
2 Replies
Message 1 of 3

Make my updated input message box results show in message

tracey_prior8CZVC
Explorer
Explorer

I have code that looks for a multi value List parameter on a drawing called Notes, and adds it if missing.  Then allows me to add to the multivalue list from an input message box.  Now I want the list to show in a message box.  I only manage to see the list  minus the just inputted.  Plus I want the list to stay up until I close it.  

This is a running tally of to do task until first issue.

 

Dim drawDoc As DrawingDocument = ThisDoc.Document
Dim drawParams As UserParameters = drawDoc.Parameters.UserParameters
Dim testParam As UserParameter

Try
	testParam = drawParams.Item("Notes")
Catch 
	testParam = drawParams.AddByValue("Notes" , "My Notes", UnitsTypeEnum.kTextUnits)
End Try
	MultiValue.SetList("Notes", "My Notes")
	
	'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	Dim List As New ArrayList 
List = MultiValue.List("Notes")
Dim msg1 As String = vbCrLf & vbCrLf
For Each sVal As String In List
	msg1 += "" & sVal & vbCrLf
	
Next
Dim val As String = InputBox("Write your note. Available Notes: " & msg1, "Adding Note to List",)
MessageBox.Show(msg1)
If val = Nothing Then Exit Sub
	If List.Contains(val) = False Then List.Add(val)
		
MultiValue.List("Notes") = List 
0 Likes
Accepted solutions (1)
328 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @tracey_prior8CZVC  

 

Welcome to the forums. Give this version a try.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim drawDoc As DrawingDocument = ThisDoc.Document
Dim drawParams As UserParameters = drawDoc.Parameters.UserParameters
Dim testParam As UserParameter

Try
	testParam = drawParams.Item("Notes")
Catch
	testParam = drawParams.AddByValue("Notes", "My Notes", UnitsTypeEnum.kTextUnits)
	MultiValue.SetList("Notes", "My Notes")
End Try

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dim List As New ArrayList
List = MultiValue.List("Notes")


Dim msg1 As String = vbCrLf & vbCrLf
For Each sVal As String In List
	msg1 += "" & sVal & vbCrLf
Next

Dim val As String = InputBox("Write your note. Available Notes: " & msg1, "Adding Note to List", )

If val = Nothing Then Exit Sub
If List.Contains(val) = False Then List.Add(val)

msg1 = Nothing
For Each sVal As String In List
	msg1 += "" & sVal & vbCrLf
Next

MessageBox.Show(msg1)

MultiValue.List("Notes") = List 

 

EESignature

0 Likes
Message 3 of 3

tracey_prior8CZVC
Explorer
Explorer

Thank you Curtis, this works perfectly 🙂

0 Likes