.NET

Reply
Distinguished Contributor
368 Posts
0 Kudos
Registered: ‎12-05-2003
Post 1 of 3

ZoomWindow does not work

126 Views, 2 Replies
01-31-2006 07:41 AM
Hi,
I got a problem to ZoomWindow. What's wrong with the code?

Thank you.

[code]
[CommandMethod("Zoom_Test")]
static public void Zoom_Test()
{
Point3d ptll = new Point3d(0,0,0);
Point3d ptur = new Point3d(100,100,0);

Autodesk.AutoCAD.Interop.AcadApplication pApp;
pApp = (Autodesk.AutoCAD.Interop.AcadApplication) Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;
// Object ll = (Object) ptll;
// Object ur = (Object) ptur;
// pApp.ZoomWindow(ll, ur);
pApp.ZoomWindow(ptll, ptur);
}
[/code]
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
New Member
2 Posts
0 Kudos
Registered: ‎11-17-2005
Post 2 of 3

Re: ZoomWindow does not work

02-08-2006 06:08 AM in reply to: wesbird
Hi,

You need to use Double[] instead of Point3d, so the ToArray() function converts point3d to Double Array. See the code:

[CommandMethod("Zoom_Test")]
static public void Zoom_Test()
{
Point3d ptll = new Point3d(0,0,0);
Point3d ptur = new Point3d(100,100,0);

Autodesk.AutoCAD.Interop.AcadApplication pApp;
pApp = (Autodesk.AutoCAD.Interop.AcadApplication) Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;

pApp.ZoomWindow(ptll.ToArray() , ptur.ToArray());
}

Regards,
Pedro Henrique Liberato
Distinguished Contributor
368 Posts
0 Kudos
Registered: ‎12-05-2003
Post 3 of 3

Re: ZoomWindow does not work

02-08-2006 06:19 AM in reply to: wesbird
Thank you, It works great.


Wes
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!