我用过了,这个我知道的
我是在一点程序里运行的,老是在这一段停住了,
lineobj1 as acadline
For Each entobj3 In objselectionset1 For Each entobj4 In objselectionset4 Set lineobj = entobj3 pt = entobj3.IntersectWith(entobj4, acExtendNone)
lineobj1 = ThisDrawing.ModelSpace.AddLine(lineobj.StartPoint, pt)
错误提示内容为:对象变量或with块变量未设置
在程序里我从没用过with块,你可以知道大概是哪里有问题吗?》
Else: lineobj1.Delete End If If Sqr((lineobj2.StartPoint(0) - lineobj2.EndPoint(0)) ^ 2 + (lineobj2.StartPoint(1) - lineobj2.EndPoint(1)) ^ 2) < Sqr((lineobj4.StartPoint(0) - lineobj4.EndPoint(0)) ^ 2 + (lineobj4.StartPoint(1) - lineobj4.EndPoint(1)) ^ 2) Then lineobj2.Delete Else: lineobj4.Delete End If flog = True End If Next entobj3.Delete Next
其中objselectionset1为两条横放直线,objselectionset2为两条竖放直线