Proctor Posted July 2, 2010 Share Posted July 2, 2010 Hello: I created a program that's been working perfect; however, I recently placed it on a machine and it wasn't working and so of coarse I debugged it and found out that when it's getting the length of the spline, for some reason placing a comma in where there use to be a decimal e.g 5.123 becomes 5,123. it's very strange. here's the bit of code that's running: If TypeOf ssobject Is AcadSpline Then Set MySpline = ssobject MyLineType = MySpline.Linetype 'THIS SCRIPT SENDS IN PARAMS and calls A LISP FUNCTION TO CALCULATE THE LENGTH OF A SPLINE 'WASNT ABLE TO FIND LENGTH W/ VBA SO HAD TO MAKE CALL LISP FUNCTION vlax-curve-getdistatparam to get it. With ThisDrawing ThisDrawing.SetVariable "USERR1", sVar 'load lisp .SendCommand "(vl-load-com)" & vbCr 'call lisp function and pass in params. return length of spline strCom = "(setvar " & Chr(34) & "USERR1" & Chr(34) & Chr(32) & "(vlax-curve-getdistatparam (vlax-ename->vla-object (handent " & Chr(34) & ssobject.Handle & Chr(34) & ")) (vlax-curve-getendparam (vlax-ename->vla-object (handent " & Chr(34) & ssobject.Handle & Chr(34) & ")))))" & vbCr .SendCommand strCom [color=red] MyLineLength = .GetVariable("USERR1")[/color] End With End if The line in red is when it gets the length of the spline and i see the comma instead of the decimal. Thanks for your help, Proctor Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 2, 2010 Share Posted July 2, 2010 Please check Control Panel --> Regional And Language Options --> Customize... for that station; most probably the decimal separator symbol is set to comma. Regards, Quote Link to comment Share on other sites More sharing options...
Proctor Posted July 2, 2010 Author Share Posted July 2, 2010 msasu ...that resolved it!!! Thank you so much for letting me know about this setting!!! Proctor Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 2, 2010 Share Posted July 2, 2010 You're welcome! Glad to help you. But my suggestion is to add a protection in your code for such cases (i.e. a custom function for conversion string-to-double). Regards, Quote Link to comment Share on other sites More sharing options...
Proctor Posted July 6, 2010 Author Share Posted July 6, 2010 That is a good suggestion....I will do that. Thanks again, Proctor Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.