wit0708 发表于 2019-3-14 13:06:00

用VLAX时不时的CAD程序自动退出

我用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

zzyong00 发表于 2019-3-19 13:46:00

VLAX的确不是很稳定,常有莫名其妙的问题,而且,自从R16以后就没更新过,所以,不要报太大希望。

wit0708 发表于 2019-3-20 08:47:00


谢谢您,时好时坏的,确实找不到原因啊

ayslh 发表于 2019-3-28 10:03:00

碰到相同的问题!也一直找不到好的解决办法!

yzg_208 发表于 2019-7-27 15:04:00

2014下基本不能用
页: [1]
查看完整版本: 用VLAX时不时的CAD程序自动退出