无法使用点捕捉
这样不行
Dim Bp As Variant
Bp = ThisDrawing.Utility.GetPoint(, "选择端点: ")
这样也不行
Dim Bp As Variant
set Bp = ThisDrawing.Utility.GetPoint(, "选择端点: ")
使用点捕捉就出错
感谢各位大侠解决
感谢!!!感谢!!!
附上我用的测试代码,选择点时可用捕捉,也可不用,用点的对象捕捉也没出问题,不知道你那怎么了,应该不是代码的原因。
Private Sub AcadDocument_BeginDoubleClick(ByVal PickPoint As Variant)
Dim Bp, Ep As Variant
Bp = ThisDrawing.Utility.GetPoint(, "选择端点: ")
Ep = ThisDrawing.Utility.GetPoint(Bp, "选择终点: ")
Dim obj As AcadLine
Set obj = ThisDrawing.ModelSpace.AddLine(Bp, Ep)
End Sub
请看下面代码
Sub xh()
Dim p1(2) As Double, p2(2) As Double
Dim OffsetValue As Double
Dim offsetvalue1 As Double
Dim lineobj As AcadLine
Dim Bp As Variant
Bp = ThisDrawing.Utility.GetPoint(, "选择端点: ")
OffsetValue = ThisDrawing.Utility.GetReal("请输入偏移距离:")
offsetvalue1 = ThisDrawing.Utility.GetReal("所需线段长度")
p1(0) = Bp(0) + OffsetValue
p1(1) = Bp(1)
p1(2) = 0
p2(0) = p1(0) + offsetvalue1
p2(1) = p1(1)
p2(2) = 0
Set lineobj = ThisDrawing.ModelSpace.AddLine(p1, p2)
End Sub
不捕捉点时是正确的
请指正
谢谢!!!