How to locate a shape on a page ?

C

clement38

Hi everybody,

I'm new in add-ins development for visio . And I'm playing with shapes
coordinates, but I would like to know how could I have the x, y
coordinates of each points of a shapes ?
For now, I use the visX/visY and BeginX/BeginY cell of the shape, but
I would like to draw at specified places on the page depending on the
others shapes.

I'm sorry for my bad english, but I hope I'm enough clear...

If somebody can help me, it would be very nice !
 
P

Paul Herber

Hi everybody,

I'm new in add-ins development for visio . And I'm playing with shapes
coordinates, but I would like to know how could I have the x, y
coordinates of each points of a shapes ?
For now, I use the visX/visY and BeginX/BeginY cell of the shape, but
I would like to draw at specified places on the page depending on the
others shapes.

I'm sorry for my bad english, but I hope I'm enough clear...

If somebody can help me, it would be very nice !

You need to look at the Geometry section(s) of the shape.

The first geometry section is referenced as visSectionFirstComponent
and the section cells can be read using the shape's CellSRC method.

This reads the X and Y cells for the 1st geometry section (adjust the
grammar to suit your programming language)

for n := 0 to shape.RowCount[visSectionFirstComponent]-1 do
begin
x := shape.CellsSRC [visSectionFirstComponent, n, visX].GetFormula;
y := shape.CellsSRC [visSectionFirstComponent, n, visY].GetFormula;
display (x, y);
end;
 
C

clement38

Hi everybody,
I'm new in add-ins development for visio . And I'm playing with shapes
coordinates, but I would like to know how could I have the x, y
coordinates of each points of a shapes ?
For now, I use the visX/visY and BeginX/BeginY cell of the shape, but
I would like to draw at specified places on the page depending on the
others shapes.
I'm sorry for my bad english, but I hope I'm enough clear...
If somebody can help me, it would be very nice !

You need to look at the Geometry section(s) of the shape.

The first geometry section is referenced as visSectionFirstComponent
and the section cells can be read using the shape's CellSRC method.

This reads the X and Y cells for the 1st geometry section (adjust the
grammar to suit your programming language)

for n := 0 to shape.RowCount[visSectionFirstComponent]-1 do
begin
x := shape.CellsSRC [visSectionFirstComponent, n, visX].GetFormula;
y := shape.CellsSRC [visSectionFirstComponent, n, visY].GetFormula;
display (x, y);
end;


Nice !

Thank you for your answer !
I use the getcellssrc function and xytopage function to get the
coordinates in the "page coordinates".
But I have another little problem. The x' and y' returned by xytopage
are in internal drawing units. How can I convert it in inches or
millimeters ?
I saw the convertResult function but I didn't arrive to make it
working ?...

Thank you again for you answer !

Clement.
 
P

Paul Herber

Hi everybody,
I'm new in add-ins development for visio . And I'm playing with shapes
coordinates, but I would like to know how could I have the x, y
coordinates of each points of a shapes ?
For now, I use the visX/visY and BeginX/BeginY cell of the shape, but
I would like to draw at specified places on the page depending on the
others shapes.
I'm sorry for my bad english, but I hope I'm enough clear...
If somebody can help me, it would be very nice !

You need to look at the Geometry section(s) of the shape.

The first geometry section is referenced as visSectionFirstComponent
and the section cells can be read using the shape's CellSRC method.

This reads the X and Y cells for the 1st geometry section (adjust the
grammar to suit your programming language)

for n := 0 to shape.RowCount[visSectionFirstComponent]-1 do
begin
x := shape.CellsSRC [visSectionFirstComponent, n, visX].GetFormula;
y := shape.CellsSRC [visSectionFirstComponent, n, visY].GetFormula;
display (x, y);
end;


Nice !

Thank you for your answer !
I use the getcellssrc function and xytopage function to get the
coordinates in the "page coordinates".
But I have another little problem. The x' and y' returned by xytopage
are in internal drawing units. How can I convert it in inches or
millimeters ?

Internal drawing units are in inces I believe, to get a numerical
answer rather than the cell formula you want to use .Result instead of
..GetFormula and the Result method takes a parameter of the units type
i.e. .Result['mm']
 
C

clement38

On 9 Apr 2007 12:49:51 -0700, "(e-mail address removed)"
Hi everybody,
I'm new in add-ins development for visio . And I'm playing with shapes
coordinates, but I would like to know how could I have the x, y
coordinates of each points of a shapes ?
For now, I use the visX/visY and BeginX/BeginY cell of the shape, but
I would like to draw at specified places on the page depending on the
others shapes.
I'm sorry for my bad english, but I hope I'm enough clear...
If somebody can help me, it would be very nice !
You need to look at the Geometry section(s) of the shape.
The first geometry section is referenced as visSectionFirstComponent
and the section cells can be read using the shape's CellSRC method.
This reads the X and Y cells for the 1st geometry section (adjust the
grammar to suit your programming language)
for n := 0 to shape.RowCount[visSectionFirstComponent]-1 do
begin
x := shape.CellsSRC [visSectionFirstComponent, n, visX].GetFormula;
y := shape.CellsSRC [visSectionFirstComponent, n, visY].GetFormula;
display (x, y);
end;
Thank you for your answer !
I use the getcellssrc function and xytopage function to get the
coordinates in the "page coordinates".
But I have another little problem. The x' and y' returned by xytopage
are in internal drawing units. How can I convert it in inches or
millimeters ?

Internal drawing units are in inces I believe, to get a numerical
answer rather than the cell formula you want to use .Result instead of
.GetFormula and the Result method takes a parameter of the units type
i.e. .Result['mm']



Yes, I already use getResult but if I put Vismillimeters as parameter
for the units type,
xytopage function doesn't work correctly.
xytopage is working only if I use the visDrawingUnits parameter for
getResult. I tried inches, millimeters but w/o success.
I think I have to convert after the xytopage but I don't know how ?

Thanks again.

Clement.
 
P

Paul Herber

On 10 avr, 10:41, Paul Herber <[email protected]>
wrote:
On 9 Apr 2007 12:49:51 -0700, "(e-mail address removed)"
Hi everybody,
I'm new in add-ins development for visio . And I'm playing with shapes
coordinates, but I would like to know how could I have the x, y
coordinates of each points of a shapes ?
For now, I use the visX/visY and BeginX/BeginY cell of the shape, but
I would like to draw at specified places on the page depending on the
others shapes.
I'm sorry for my bad english, but I hope I'm enough clear...
If somebody can help me, it would be very nice !
You need to look at the Geometry section(s) of the shape.
The first geometry section is referenced as visSectionFirstComponent
and the section cells can be read using the shape's CellSRC method.
This reads the X and Y cells for the 1st geometry section (adjust the
grammar to suit your programming language)
for n := 0 to shape.RowCount[visSectionFirstComponent]-1 do
begin
x := shape.CellsSRC [visSectionFirstComponent, n, visX].GetFormula;
y := shape.CellsSRC [visSectionFirstComponent, n, visY].GetFormula;
display (x, y);
end;
Thank you for your answer !
I use the getcellssrc function and xytopage function to get the
coordinates in the "page coordinates".
But I have another little problem. The x' and y' returned by xytopage
are in internal drawing units. How can I convert it in inches or
millimeters ?

Internal drawing units are in inces I believe, to get a numerical
answer rather than the cell formula you want to use .Result instead of
.GetFormula and the Result method takes a parameter of the units type
i.e. .Result['mm']



Yes, I already use getResult but if I put Vismillimeters as parameter
for the units type,
xytopage function doesn't work correctly.
xytopage is working only if I use the visDrawingUnits parameter for
getResult. I tried inches, millimeters but w/o success.
I think I have to convert after the xytopage but I don't know how ?

Ok, work in inches, then when done convert to millimeters by
multiplying by 25.4
 
C

clement38

On 10 Apr 2007 07:32:19 -0700, "(e-mail address removed)"
On 10 avr, 10:41, Paul Herber <[email protected]>
wrote:
On 9 Apr 2007 12:49:51 -0700, "(e-mail address removed)"
Hi everybody,
I'm new in add-ins development for visio . And I'm playing with shapes
coordinates, but I would like to know how could I have the x, y
coordinates of each points of a shapes ?
For now, I use the visX/visY and BeginX/BeginY cell of the shape, but
I would like to draw at specified places on the page depending on the
others shapes.
I'm sorry for my bad english, but I hope I'm enough clear...
If somebody can help me, it would be very nice !
You need to look at the Geometry section(s) of the shape.
The first geometry section is referenced as visSectionFirstComponent
and the section cells can be read using the shape's CellSRC method.
This reads the X and Y cells for the 1st geometry section (adjust the
grammar to suit your programming language)
for n := 0 to shape.RowCount[visSectionFirstComponent]-1 do
begin
x := shape.CellsSRC [visSectionFirstComponent, n, visX].GetFormula;
y := shape.CellsSRC [visSectionFirstComponent, n, visY].GetFormula;
display (x, y);
end;
--
Regards, Paul Herber, Sandrila Ltd.
Electronics for Visio http://www.electronics.sandrila.co.uk/
Nice !
Thank you for your answer !
I use the getcellssrc function and xytopage function to get the
coordinates in the "page coordinates".
But I have another little problem. The x' and y' returned by xytopage
are in internal drawing units. How can I convert it in inches or
millimeters ?
Internal drawing units are in inces I believe, to get a numerical
answer rather than the cell formula you want to use .Result instead of
.GetFormula and the Result method takes a parameter of the units type
i.e. .Result['mm']
Yes, I already use getResult but if I put Vismillimeters as parameter
for the units type,
xytopage function doesn't work correctly.
xytopage is working only if I use the visDrawingUnits parameter for
getResult. I tried inches, millimeters but w/o success.
I think I have to convert after the xytopage but I don't know how ?

Ok, work in inches, then when done convert to millimeters by
multiplying by 25.4

Great, it works !

Thank you for your help !

Regards,

Clement
 

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