CXB 发表于 2005-3-7 19:04:00

[求助]VBA临时捕捉问题?

VBA进行取点时(thisdrawing.Utility.GetPoint),无法使用临时捕捉,有什么解决方法。

mccad 发表于 2005-3-7 21:07:00

你自己有没有试过。如果试过请贴出你的代码。

CXB 发表于 2005-3-8 20:07:00

On Error Resume Next


Dim line1 As AcadLine<BR>Dim firstPoint As Variant<BR>Dim bpt1 As Variant: bpt2 As Variant: bpt3 As Variant


firstPoint = ThisDrawing.Utility.GetPoint(, vbCrLf &amp; "请插入")


bpt1 = firstPoint<BR>bpt2 = ThisDrawing.Utility.GetPoint(bpt1, "请插入")


Set line1 = ThisDrawing.ModelSpace.AddLine(bpt1, bpt2)


Err.Clear


Do While Err.Number = 0<BR>                       bpt3 = ThisDrawing.Utility.GetPoint(bpt2, "请插入")<BR>                       Set line1 = ThisDrawing.ModelSpace.AddLine(bpt2, bpt3)<BR>                       bpt2 = bpt3<BR>Loop


程序为连续画线,通过右键结束.<BR>在画线过程中,一旦点击对象捕捉工具条,使用临时捕捉,程序就会跳出.<BR>错误为"未知命令".<BR>

my_computer 发表于 2005-3-9 18:10:00

使用 Do While Err.Number &lt;&gt; -2147467259
页: [1]
查看完整版本: [求助]VBA临时捕捉问题?