Hi everybody, this is my second topic upon that issue. The first one was here: http://forums.autodesk.com/t5/Autodesk-Inventor/iL
To resume the issue here, my problem is that I did, a couple of months ago, a part with a rule containing some input boxes. It worked without a bug and set it as a specific template, on Inventor 2012.
I tried to reuse it as a template without changing its rule on Inventor 2013. When the input box pops out and ask the value it needs, if I type "0.2" it says that "string's conversion "0.2" in a 'double' type isn't valid". But if I type "0,2" I have absolutely no problems.
And on the "more infos" tab, I can see that message:
"System.InvalidCastException: La conversion de la chaîne "0.2" en type 'Double' n'est pas valide. ---> System.FormatException: Le format de la chaîne d'entrée est incorrect.
--- Fin de la trace de la pile d'exception interne ---
à iLogic.RuleEvalContainer.ExecRuleEval(String execRule) "
I work on:
Autodesk design suite premium 2013 french.
Solved! Go to Solution.
Does the code below error out for you, when you type in 0.2 ?
Dim iString As String Dim iDoub As Double '''/////////// Let's ask the user to type something in iString = InputBox("Super String Converter-o-Matic 2012", "Strings --> Doubles!", "") '''/////////// If the input can be succesfully considered a number, then we proceed If IsNumeric(iString) = True Then '''/////////// If it is a number, we'll set our variable 'iDoub' to equal the String, converted over '''/////////// into a double iDoub = CDbl(iString) '''/////////// Now we show you the result MessageBox.Show("Your Double Is : " & iDoub, "Converted!") Else '''/////////// If the variable 'iString' can't be considered to have a numeric value, then we '''/////////// tell the user that we can't convert their input MessageBox.Show("We can't convert letters to numbers! We have standards!", "Not-Converted!") End If
Hi Megajerk, Thanks for your answer.
So It doesn't error me out, it says your message "We can't convert letters to numbers! We have standards!"
Makes me smile.
So must I apply it to my code?
Actually, if you're getting that message when you type in 0.2 (zero point two), then there certainly is something wrong.
Try the following code and tell me the values that it returns back to you in the final box.
Dim oBlah,oLaLa As String Dim oDarn As Char oBlah = InputBox("Input your string", "String Detective", "") For Each oDarn In oBlah If oLaLa = "" Then oLaLa = (Asc(oDarn)) Else oLaLa = oLaLa & "," & (Asc(oDarn)) End If Next MessageBox.Show(oLaLa,"String Detective Has Found This!")
So when you run that code, type in your 0.2, and tell me what three numbers you get back.
Well that’s what you should be getting. You may have a rather unique problem on your hand being that you’re input of 0.2 is producing the correct Ascii values (48,46,50), but the function ‘IsNumeric’ is refusing to accept that as a proper numeric value (despite the fact that it is).
Perhaps someone from Autodesk would be willing to dig deeper into this. Perhaps it’s a localization bug.
I’m sorry that I couldn’t be more useful.
Hi again everybody, after looking a bit more on the web, it seems that this issue is not related to inventor, but to visual basic. Some people have the same kind of problem, but on other software. But I'm searching, and nobody seems to have a real solution. Could someone help me?
Does the following code give you the "Unable to parse" or does it return a message box with the correct numerical value in it?
Dim value As String Dim result As Decimal value = "0.2" If Decimal.TryParse(value, result) MessageBox.Show(result) Else MessageBox.Show("Unable to parse: " & value,"") End If
(That is for ilogic)
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.