Proctor
2nd Jul 2010, 06:57 pm
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
MyLineLength = .GetVariable("USERR1")
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
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
MyLineLength = .GetVariable("USERR1")
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