.NET

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

ZoomWindow does not work

118 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]
New Member
phol
Posts: 2
Registered: ‎11-17-2005
Message 2 of 3 (118 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: 347
Registered: ‎12-05-2003
Message 3 of 3 (118 Views)

Re: ZoomWindow does not work

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


Wes

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community