Inventor Customization

Reply
Valued Contributor
fakeru
Posts: 87
Registered: ‎03-07-2010
Message 1 of 3 (183 Views)

Setting MultiValue List to a paramter

183 Views, 2 Replies
01-21-2013 01:08 AM

Hello

I have the following rule:


If OD=900 mm And Filter_Type = "Aerob" Then
MultiValue.SetList("FilterSize", 0.2, 0.3, 0.4, 0.5, 2.2, 2.3, 2.4, 2.5)
End If

If OD=900 mm And Filter_Type = "Donaldson DLM" Then
MultiValue.SetList("FilterSize", V3/7S, V4/7S, V8/7S)
End If

 For first condition everything is ok. But when the second one is valid it gives error:

Conversion from string "V3/7" to type 'Double' is not valid.

Maybe I should add that the parameter "FilterSize" was made as Text and multi-value.

And of course I not familiar at all with programming...

What would be the solution?

 

Thanks

AIP 2014
Windows 7 x64
Dell Precision T7400 Intel(R) Xeon(R) CPU X5472 @ 3.00GHz (4 CPU's), 8Gb RAM, NVIDIA Quadro FX 5600 1536MB GDDR3
Mentor
MegaJerk
Posts: 266
Registered: ‎01-26-2011
Message 2 of 3 (169 Views)

Re: Setting MultiValue List to a paramter

01-21-2013 05:32 AM in reply to: fakeru

I noticed that you are using a variable called '7S'. Could you give me the rest of the code so that I can see how those variables are being initialized? Being that you can't begin an Inventor parameter using a number I assume that it is being declared via a DIM inside of your iLogic. No matter, it may be causing the problem.

 

 

I ran a test (switching that to S7) with the below code, and ran into no problems.

 

'' Here is a test to perform. 
'' The parameter type of all the INVENTOR parameters are as follows. 

' Filter_Type --- Text - Multivalue w/(2) values : ("Filter1", "Filter2") 
' FilterSize --- mm - Multivalue w/(?) values : Is assigned by iLogic below
' OD --- mm - Single Value : currently 900mm 

'Notice that 7S has been changed to S7!
Dim V3, V4, V8, S7 As Double


V3 = 300 mm 
V4 = 400 mm 
V8 = 800 mm
S7 = 7 ul  

If OD=900 mm And Filter_Type = "Filter1" Then
MultiValue.SetList("FilterSize", 0.2, 0.3, 0.4, 0.5, 2.2, 2.3, 2.4, 2.5)
End If

If OD=900 mm And Filter_Type = "Filter2" Then
MultiValue.SetList("FilterSize", V3/S7, V4/S7, V8/S7)
End If

 

--------------------------------------------------------------------------------------

If my solution seems to remedy your problem, please press the Accept Solution button, -
as it increases my power levels and will eventually help to elevate me towards outer space.

Check out my iLogic injection tool here : http://goo.gl/ce1Qg
--------------------------------------------------------------------------------------
Valued Contributor
fakeru
Posts: 87
Registered: ‎03-07-2010
Message 3 of 3 (162 Views)

Re: Setting MultiValue List to a paramter

01-21-2013 07:30 AM in reply to: MegaJerk

Sorry, I was not precise with my description and the code. I have found the mistake.

I will simplify my initial code:

If OD=900 mm And Filter_Type = "Donaldson DLM" Then
MultiValue.SetList("Filter_Size", "V3/7S", "V4/7S")
End If

If OD=900 mm And Filter_Type = "Aerob" Then
MultiValue.SetList("Filter_Size", "0.2", "0.3")
End If

If Filter_Size= 0.2 Then
d1= 100 mm
d2= 200 mm
End If

If Filter_Size= 0.3 Then
d1= 100 mm
d2= 300 mm
End If

If Filter_Size= "V3/7S" Then
d1= 150 mm
d2= 200 mm
End If

If Filter_Size= "V4/7S" Then
d1= 250 mm
d2= 100 mm
End If

 Just because I didn't use double quote in line 9 and 14 for the value of Filter_Size I had this error.

So it should be like this:

If Filter_Size= "0.2" Then

and

If Filter_Size= "0.3" Then

 

In my first post I didn't wrote the other code which was using the same "Filter_Size". So it was hard to understand.

 

Thanks anyway for your try!

AIP 2014
Windows 7 x64
Dell Precision T7400 Intel(R) Xeon(R) CPU X5472 @ 3.00GHz (4 CPU's), 8Gb RAM, NVIDIA Quadro FX 5600 1536MB GDDR3

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube