DrawLine

B

Bragadiru

Hi all,

When I'm drwing a line in Visio 2003 with C# :
Visio.Shape newLine = visioDocument.Pages[1].DrawLine(1.1,1.1, 2.2, 2.2);

x or y coordinates are in pixels / m / mm / cm / inches / ... ???
How can I find the current page - unit of measurement ?

Thanks for any advice
 
F

fredd

The Drawline method always takes its input in Visio internal units which are
always inches. If you are working in different units you'll need to do the
conversion when setting up the parameters to Drawline.
 
B

Bragadiru

Thanks Fred.

Now, how can I find the current units used ? I didn't find any property or
method of Page/Application object.



fredd said:
The Drawline method always takes its input in Visio internal units which
are
always inches. If you are working in different units you'll need to do
the
conversion when setting up the parameters to Drawline.

Bragadiru said:
Hi all,

When I'm drwing a line in Visio 2003 with C# :
Visio.Shape newLine = visioDocument.Pages[1].DrawLine(1.1,1.1, 2.2, 2.2);

x or y coordinates are in pixels / m / mm / cm / inches / ... ???
How can I find the current page - unit of measurement ?

Thanks for any advice
 
F

fredd

Well, I looked into this and couldn't find any way to get the page's
measurement units directly from the object model. Here is a work around and
if someone thinks they have a better way, feel free to offer it up.

You can get the page units indirectly by drawing a shape onto the page. Use
one of the draw routines, such as DrawRectangle, so that the cells don't
inherit from a master. Then check the Units property of the PageWidth or
PageHeight cells. The units should be the same as the page units.

Good luck!


Bragadiru said:
Thanks Fred.

Now, how can I find the current units used ? I didn't find any property or
method of Page/Application object.



fredd said:
The Drawline method always takes its input in Visio internal units which
are
always inches. If you are working in different units you'll need to do
the
conversion when setting up the parameters to Drawline.

Bragadiru said:
Hi all,

When I'm drwing a line in Visio 2003 with C# :
Visio.Shape newLine = visioDocument.Pages[1].DrawLine(1.1,1.1, 2.2, 2.2);

x or y coordinates are in pixels / m / mm / cm / inches / ... ???
How can I find the current page - unit of measurement ?

Thanks for any advice
 
M

Mark Nelson [MS]

The page units are found in the PageScale cell. Check the Units property of
this value.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

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

fredd said:
Well, I looked into this and couldn't find any way to get the page's
measurement units directly from the object model. Here is a work around
and
if someone thinks they have a better way, feel free to offer it up.

You can get the page units indirectly by drawing a shape onto the page.
Use
one of the draw routines, such as DrawRectangle, so that the cells don't
inherit from a master. Then check the Units property of the PageWidth or
PageHeight cells. The units should be the same as the page units.

Good luck!


Bragadiru said:
Thanks Fred.

Now, how can I find the current units used ? I didn't find any property
or
method of Page/Application object.



fredd said:
The Drawline method always takes its input in Visio internal units
which
are
always inches. If you are working in different units you'll need to do
the
conversion when setting up the parameters to Drawline.

:

Hi all,

When I'm drwing a line in Visio 2003 with C# :
Visio.Shape newLine = visioDocument.Pages[1].DrawLine(1.1,1.1, 2.2,
2.2);

x or y coordinates are in pixels / m / mm / cm / inches / ... ???
How can I find the current page - unit of measurement ?

Thanks for any advice
 

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