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
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
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!