Dim IntPoint As Variant IntPoint = Obj1.IntersectWith(Obj2, acExtendNone)
If VarType(IntPoint) <> vbEmpty Then
...
End If
VarType(IntPoint)无论在相交与否都返回8197(不相交时为0),请问为什么?
Dim a As AcadLine Set a = ThisDrawing.ModelSpace(0) Set b = ThisDrawing.ModelSpace(1) c = a.IntersectWith(b, acExtendNone) MsgBox UBound(c) MsgBox IsArray(c)
试试这段代码,如果a,b不相交UBound(c)=-1
这在VB里是做不出来的,下界为0,上界为-1 ?但是有确实是一个数组