.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ZoomWindow does not work

2 REPLIES 2
Reply
Message 1 of 3
wesbird
264 Views, 2 Replies

ZoomWindow does not work

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]
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
2 REPLIES 2
Message 2 of 3
phol
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
Message 3 of 3
wesbird
in reply to: wesbird

Thank you, It works great.


Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost