Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

InputListBox gives an unhandled exception error

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
CadVanRiet
499 Views, 3 Replies

InputListBox gives an unhandled exception error

Hi all,

 

I'm working on some iLogic code but it gives me an error

The strange thing is that the error apperase when i use the code as an External Rule.

When i copy the code to a Rule (local rule) the error does not appear.

In both rules the code works correct, but i like to use it as an External Rule, without the error.

I have made a User Parameter: "Keuze" that hase a Multivalue.

 

Hope you can help me,

 

Robert

 

Dim oPartDoc as PartDocument = ThisDoc.Document
Dim userParams As UserParameters = oPartDoc.ComponentDefinition.Parameters.UserParameters
Try
    Keuze_Params = oPartDoc.ComponentDefinition.Parameters("Keuze")
Catch
    Dim newParam As UserParameter = userParams.AddByValue("Keuze", "", UnitsTypeEnum.kTextUnits)
End Try
MultiValue.List("Keuze") = GoExcel.CellValues("C:\temp\iLogic.xlsx", "Sheet1", "A2", "A6")
Keuze= InputListBox("Huidige keuze: "& iProperties.Value("Project", "Description"), MultiValue.List("Keuze"), Keuze, Title := "Keuzelijst:", ListName := "Type keuze")
If Keuze = Nothing Then Exit Sub    
LineNumber=GoExcel.FindRow("C:\temp\iLogic.xlsx", "Sheet1", "Naam", "=", Keuze)
iProperties.Value("Project", "Description") = GoExcel.CurrentRowValue("Code") 

 

3 REPLIES 3
Message 2 of 4
Carthik_Babu
in reply to: CadVanRiet

Hi,

 

Kindly assign "Test 1" instead of Keuze in your code....as shown below in your code...

Keuze= InputListBox("Huidige keuze: "& iProperties.Value("Project", "Description"), MultiValue.List("Keuze"), "Test 1", Title := "Keuzelijst:", ListName := "Type keuze")

 

 

 

 

 

 

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 3 of 4
CadVanRiet
in reply to: Carthik_Babu

If everything was so simple....just i didn't find it.
Thanks for helping out.
Message 4 of 4
Carthik_Babu
in reply to: CadVanRiet

The Problem is "Keuze" is considered as an array string in External Rule and not as parameter. You can see the color difference in Ilogic Browser of both Internal & External Rule.
Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report