用VLAX时不时的CAD程序自动退出
本帖最后由 wit0708 于 2019-3-14 13:07 编辑我用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
VLAX的确不是很稳定,常有莫名其妙的问题,而且,自从R16以后就没更新过,所以,不要报太大希望。 zzyong00 发表于 2019-3-19 13:46
VLAX的确不是很稳定,常有莫名其妙的问题,而且,自从R16以后就没更新过,所以,不要报太大希望。
谢谢您,时好时坏的,确实找不到原因啊 碰到相同的问题!也一直找不到好的解决办法! 2014下基本不能用
页:
[1]