VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

intersectwith

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
552 Views, 3 Replies

intersectwith

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
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

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
Message 3 of 4
Anonymous
in reply to: Anonymous

thanks for your prompt and illuminating reply. maybe someone at autodesk is listening eh?

my latest version of the program uses a region as boundary but i guess it will work/not work just the same.

onwards and upwards

paul coates
Message 4 of 4
Anonymous
in reply to: Anonymous

fwiw,
intersection of a 3dsolid and a circle would contain an infinite number or
points. from this perspective, i wouldn't say that is a bug.

"Norman Yuan" wrote in message
news:4863319@discussion.autodesk.com...
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost