Generic .Net method to replace iLogic's InputListBox

Generic .Net method to replace iLogic's InputListBox

Maxim-CADman77
Advisor Advisor
627 Views
5 Replies
Message 1 of 6

Generic .Net method to replace iLogic's InputListBox

Maxim-CADman77
Advisor
Advisor

I'd like to know if there any generic VB.Net method to replace InputListBox from Autodesk.iLogic.Runtime library?

 

Context:
Nowadays I'm working on conversion source code of my util (iLogic to VB.Net).
Obviously my Visual Studio solution references contain Autodesk.Inventor.Interop library.
In order to keep InputListBox I've also added Autodesk.iLogic.Runtime library there.

 

VB.net version of code is now works as expected ... but
... Visual Studio's "Error list" now shows:

Warning BC40059
A reference was created to embedded interop assembly 'Autodesk.Inventor.Interop, Version=27.1.0.0, Culture=neutral, PublicKeyToken=d84147f8b4276564' because of an indirect reference to that assembly from assembly 'Autodesk.iLogic.Runtime, Version=27.10.20800.0, Culture=neutral, PublicKeyToken=null'. Consider changing the 'Embed Interop Types' property on either assembly.

 

I've played around with the values of "Embed Interop Types" property of those two libs just to find there is only one valid combination: True and False consequently.

 

I know warnings are not errors and can be ignored ... yet I'd like to know if there anything I can do to remove this warning without changing initial util logics/workflow.

 

Thanks in advance!

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (2)
628 Views
5 Replies
Replies (5)
Message 2 of 6

JelteDeJong
Mentor
Mentor
Accepted solution

You might want to look at this article "Set 'Embed Interop Types' to False to avoid problems with events"

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 6

Maxim-CADman77
Advisor
Advisor

Yes - two "False" does the trick. I'll mark you post as answer a bit later.
Yet ... don't you know possible "generic" alternative to InputListBox?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 6

JelteDeJong
Mentor
Mentor

you could try this:

Dim list As New List(Of String)
list.Add("a")
list.Add("b")
list.Add("c")

Dim Box As New Autodesk.iLogic.Runtime.InputListBoxDialog("title", "listname", "instruction", list, "a")
Box.ShowDialog()

MsgBox(Box.ChosenItem)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 5 of 6

Maxim-CADman77
Advisor
Advisor

Misunderstanding.
I meant not to use Autodesk.iLogic.Runtime at all.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 6 of 6

JelteDeJong
Mentor
Mentor
Accepted solution

You can try this but I would not like it:

Dim answer = Microsoft.VisualBasic.InputBox("Your question", "title")
MsgBox(answer)

But I think your best option is to make your own form. That is more complicated and could be a whole new topic on my blog but I think you can find some guidelines on the net. maybe this helps:

https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-wpf?view=vs-2022

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes