Shape pinx,piny inside a group

M

Mads.B.Jensen

Hi Guys


Got a page where I've got some groups inside these groups I have some
shapes, I need to get the coordinates on the shapes but when I use the
"pinx" and "piny" method I get the pinx,piny value of the shape
belonging to the group - What I want is the pinx , piny coordinates of
the shapes but related to the page's coordinates.


How can I get X and Y coordinate of a shape relevant to Page and not
the group.

Yours Sincerely
ZyRaIN
 
M

Mark Nelson [MS]

Also if you are doing this through automation, use the Shape.XYToPage
method.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Z

ZyRaIN

Thanks for the reply's :)

I think that the shape.xytopage is the method which I need to use, but
how do I use it - Could you please show me an example.. ?

Yours Sincerely

ZyRaIN
 
J

John Marshall, MVP

Public Sub XYTest()

Dim shpObj As Visio.Shape
Dim x1 As Double, x2 As Double, y1 As Double, y2 As Double

' Use the lower left corner of the shape.
x1 = 0
y1 = 0

For Each shpObj In ActivePage.Shapes
shpObj.XYToPage x1, y1, x2, y2
Debug.Print x1, y1, x2, y2

shpObj.XYFromPage x1, y1, x2, y2
Debug.Print x1, y1, x2, y2
Next shpObj

End Sub

John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
Visio Wishlist http://www.mvps.org/visio/wish_list.htm
 
Z

ZyRaIN

Just wanted to say thanks so much been sitting with this problem for
over a week - and if was a mess trying to calculate the height of each
group and substracting stuff.

Thanks :)

Yours Sincerely

ZyRaIN
 

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