您好:我创建了一个工作完美的程序;然而,我最近把它放在一台机器上,它不工作了,所以我调试了它,发现当它得到样条曲线的长度时,出于某种原因,在原来是小数的地方放了一个逗号,例如5.123变为5123。这很奇怪。
下面是正在运行的代码:
- 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
红色的线是当它得到样条曲线的长度时,我看到的是逗号而不是小数点。
谢谢你的帮助,
监考人员 |