|
我用vlax的时候,容易出现错误2000,命令框显示错误:参数太少,而且是时好时坏,用的时候可以顺利进行,有的时候就报错,然后CAD程序自动关闭退出,请大家帮帮忙看看什么原因
Sub gfdd()
Dim pnt2 As Variant
Dim curve As AcadEntity
ThisDrawing.Utility.GetEntity curve, pnt2, "选择曲线:"
Dim n, i As Integer
n = 200
Dim d(1 To 200) As Double
Dim p(1 To 200, 1 To 3) As Double
Dim distance As Double
For i = 1 To n
distance = i
Dim obj As New VLAX
obj.EvalLispExpression "(setq curvel (handent " & Chr(34) & curve.Handle & Chr(34) & "))"
obj.EvalLispExpression "(setq XYZList (vlax-curve-getPointAtDist curvel " & distance & "))"
obj.EvalLispExpression "(setq x (car XYZList))"
obj.EvalLispExpression "(setq y (cadr XYZList))"
obj.EvalLispExpression "(setq z (caddr XYZList))"
p(i, 1) = obj.GetLispSymbol("x")
p(i, 2) = obj.GetLispSymbol("y")
p(i, 3) = obj.GetLispSymbol("z")
Next i
End Sub
|
|