判断直线与块是否有交点?
用 IntersectWith 判断直线与块相交时,直线明明与块不交,为什么函数判断结果是有交点?块图形是一个矩形,旋转了45度,直线在块右上角的位置但没有与块接触,函数用了acExtendNone Private Sub test() Dim ent1 As AcadEntity Dim ent2 As AcadEntity Dim pnt As Variant ThisDrawing.Utility.GetEntity ent1, pnt, ("工件1") ThisDrawing.Utility.GetEntity ent2, pnt, ("工件2") If UBound(ent1.IntersectWith(ent2, acExtendNone)) = -1 Then MsgBox "不相交" Else MsgBox "相交" End If GoTo selectd End Sub
页:
[1]