Getting BoundingBox to work

G

geejay

Has anyone been able to get BoundingBox to work?

I am trying to find out the border of all the shapes on a page, and the
results are not correct.

I am using Visio.VisBoundingBoxArgs.visBBoxExtents as a flag to
BoundingBox(), on a selection (ActiveWindow.SelectAll())
 
J

JuneTheSecond

Hi,

BoundingBox sometimes makes mistake.
For example, Bounding box returns wrong answer when you turned the selection.
I think it is a bug in Visio.
My practice is to use DrawARegion and DrawRectangle.
For example.
Sub test()
Dim shpRg As Visio.Shape
Dim shpRect As Visio.Shape
Dim x As Double, y As Double, w As Double, h As Double

Set shpRg = ActiveWindow.Selection.DrawRegion(0, 0)
x = shpRg.Cells("PinX")
y = shpRg.Cells("PinY")
w = shpRg.Cells("Width")
h = shpRg.Cells("Height")

Set shpRect = ActivePage.DrawRectangle(x - w * 0.5, y + h * 0.5, x + w *
0.5, y - h * 0.5)
shpRect.SendToBack
shpRg.Delete
End Sub

--
Best Regards.

JuneTheSecond
Now, visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top