Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Working with multi value list

8 REPLIES 8
Reply
Message 1 of 9
Jefkee
634 Views, 8 Replies

Working with multi value list

Hi,

 

I'm currently working alot with multi value lists. And when i change a certain parameter change the whole multi value list changes.

Is there a way select then a random value from the list to avoid error's?

 

Example:

 

First input: selected value 1

 

Parameter value = DIN

Other parameter Multi value list= 1;2;3;4;5

 

 

Second input: Parameter changes to ANSI and i need to auto fill in a value from the new list, to avoid a error for futher code based on the multi value parameter

 

Parameter value = ANSI

Other parameter Multi value list= 100;200;300;400;500

Inventor 2013
8 REPLIES 8
Message 2 of 9
salariua
in reply to: Jefkee

One way to do it would be to have an embedded spreadsheet.

 

and call it like this

 

Select Case Standard

Case "DIN"
MultiValue.List("Sizes") = GoExcel.CellValues("3rd Party:Embedding 2", "Sheet1", "B2", "B22")

Case "Ansi"
MultiValue.List("Sizes") = GoExcel.CellValues("3rd Party:Embedding 2", "Sheet1", "B23", "B39")

End Select

 

I guess, on this principle you can use :

 

Select Case Standard

Case "DIN"
MultiValue.SetList("Size", "0.5""", "0.75""", "1""", "1.25""", "1.5""", "2""", "3""", "4""", "6""")

Case "Ansi"
MultiValue.SetList("Size", "0.5""", "0.75""", "1""", "1.25""", "1.5""", "2""", "3""", "4""", "6""")

End Select

 

I haven't tested the above and I only mention excel because that's how I've done it.

 

520.jpg

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 3 of 9
Jefkee
in reply to: salariua

I can select my multivalues from excel that is not the problem..

 

The problem is when it switches and the value equals 1 from the list, and the new list does not contain 1 it needs to switch to a value that is in the list.

Inventor 2013
Message 4 of 9
salariua
in reply to: Jefkee

You can use find, that's what I have to select a tank volume form excel:

 

If Custom_Tank = False Then

'find the next tank size where volume is = or > than current req tank volume
i = GoExcel.FindRow("3rd Party:Embedding 2", "Sheet1","Tank_Type","=",Tank_Type,"Litres", ">=", TKVolume)

 

then I have an impossible large size as last row just to force selecting the last available size if user goes above limit.

 

521.jpg

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 5 of 9
salariua
in reply to: Jefkee

I think I understand what you're saying. Let me try it out and get back to you.

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 6 of 9
Jefkee
in reply to: salariua

Ok, thanks for the help 🙂

 

Can i ask what product you make? i can see it has somthing to do with tanks but it's not clear what kind of tanks.

Inventor 2013
Message 7 of 9
salariua
in reply to: Jefkee

It doesn't want to play ball. I tryied an intermediate parameter to hold the value and parse it over, still no luck.

 

Would it be an option to have them all in one multi-text parameter?:

 

ANSI 100

ANSI 200

ANSI 300

ANSI 400

ANSI 500

DIN 1

DIN 2

DIN 3

DIN 4

DIN 5

 

 

We are not tank manufacturers, but we buy so many we needed to be able to sketch it out and send a drawing with connection sizes and orientation. This is a water tank.

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 8 of 9
salariua
in reply to: Jefkee

Running out of time,  can't do any better:

 

Select Case FType
	
	Case "DIN"
		MultiValue.SetList("FSizes", "1", "2", "3", "4", "5")
		'If num value of FSizes type ANSI 
		'set it to smallest ANSI, this only happens when changing standard.
		If Val(FSizes) >= 100 Then
			FSizes = "1"
		End If 
	
	Case "ANSI"
		MultiValue.SetList("FSizes", "100", "200", "300", "400", "500")
		'If num value of FSizes type DIN 
		'set it to smallest ANSI, this only happens when changing standard.
		If Val(FSizes) < 100 Then
			FSizes = "100"
		End If 

End Select

 

430.gif

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 9 of 9
P_Korgaonkar
in reply to: salariua

Hello Adrian,

 

I am very new to Ilogic and have no background of programming.

I was looking for exactly the same thing you have shown here.

In my case top drop down list will be a belt series, for example series, 400 to 3000

Then next tab will show type of belt available in that series.

From there, then I want to daw geomatry of belt, from predefined sizes.

 

How do I do it,

 

Do you mind helping me with bit more details of code.

if possile can you attach a part file having a sample code?

 

Thank you for your help in advance.

 

Regards

Parag

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

Post to forums  

Autodesk Design & Make Report