This is a known bug in AutoCAD documentation on the IntersectWith() method
since the first Acad VBA release. I am just wondering long it is going to
stay there without being corrected.
As matter of fact, if the method does return a non-Empty variant, it is not
enough to guarantee an intersection: there returned Variant could be an
empty Double array (0 length array). You need to test the length of returned
array of Double type:
Dim bolIntersect As Boolean
Dim pt As Variant
pt=acadObjA.IntersectWith(acadObjB,acExtendNone)
If VarType(pt) <> vbEmpty Then
If UBound(pt) > -1 Then
bolIntersect = True
Else
bolIntersect = False
End If
Else
bolIntersect = False
End If
You probably, as I did before, followed the sample provided by Acad
document, spent precius working time in vain, just because of this
long-lived document bug (R14.01, 2000, 2000i, 2002, 2004, 2005, 2006?). It
will be very nice someone can reach AutoDesk and have it fixed in Acad2007's
document (already too late maybe?).
wrote in message news:4863126@discussion.autodesk.com...
here's another stupid question - has anybody got the intersectwith method to
work?
i am trying to test for overlap between a circle and a 3D SOLID but i never
get any data back
(boundary =Public boundary As Acad3DSolid)
'intPoints = acirc.IntersectWith(boundary, acExtendNone)
' intersection points
'If VarType(intPoints) <> vbEmpty Then
' intersect = True
'End If
the variant intpoints never gets filled with anything so overlapping things
just sail past each other