.NET

Reply
Distinguished Contributor
wesbird
Posts: 359
Registered: ‎12-05-2003
Message 1 of 3 (125 Views)

ZoomWindow does not work

125 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
phol
Posts: 2
Registered: ‎11-17-2005
Message 2 of 3 (125 Views)

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
wesbird
Posts: 359
Registered: ‎12-05-2003
Message 3 of 3 (125 Views)

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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.