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

Getboundingbox returning 0,0,0

2 REPLIES 2
Reply
Message 1 of 3
Tuoni
443 Views, 2 Replies

Getboundingbox returning 0,0,0

I have stumbled upon a large problem in a script I am currently writing.

The routine basically checks for overlapping layers - it does this by copying a reference polygon to a region and doing a series of subtractions to work out how much (if any) of the polygon overlaps another one.

The script works perfectly if the reference polygon is contained completely within another (if it is smaller), or if the reference polygon overlaps the other. HOWEVER, if the polygons have vertices which touch more than once (eg they are the same shape, or share a common series of vertices) then when I run the getboundingbox command, the arrays minExt and maxExt both return 0,0,0.

Is this a limitation with the getboundingbox command, and does anybody have any ideas on how to fix this problem?

Thanks in advance.

-Tuoni
2 REPLIES 2
Message 2 of 3
ThierryVermeersch
in reply to: Tuoni

I had the same problem.

I changed the declaration from

' This is in the vba examples
Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double

to

Dim startPoint As Variant
Dim endPoint As Variant

and it now works fine

Thierry
Message 3 of 3
derwisz6
in reply to: Tuoni

I had the same problem with polyline but the declarations changes it realy helped.

Thanks Thierry.

 

Dominik

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

Post to forums  

Autodesk Design & Make Report

”Boost