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

zoomExtents in C#

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
727 Views, 7 Replies

zoomExtents in C#

hi

iam not getting zoom option with usung .net api

can any body please me solution
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

Hello Venkatesh,

You can do this in two ways, The most preferred way is

AcadApplication pApp;

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

pApp.ZoomExtents();

and the other way is using "SendStringToExecute"

.SendStringToExecute("Zoom e ", False, False, False);
.SendStringToExecute("Zoom s 2 ", False, False, False);
.SendStringToExecute("Zoom W 0,0,0 10,10,10 ", False, False, False);

Hope this helps.

Regards,
Basha
Message 3 of 8
Anonymous
in reply to: Anonymous

but dear bash iam using present .netarx coding
iam getting this name "using Autodesk.AutoCAD.Interop;"

so what can i do for this without importing .dll?

have any other way is ther?

venkatesh
9247814116
hyderabad
Message 4 of 8
Anonymous
in reply to: Anonymous

Hi Venkatesh,

Import the COM reference AutoCAD 200X Type Library, where X is your version of AutoCAD.

Regards,
Basha
Message 5 of 8
Anonymous
in reply to: Anonymous

HI

Basha Good Morning

thanx for your spending valuable time for us giving sugetion

venkatesh
Message 6 of 8
Anonymous
in reply to: Anonymous

Hi Basha,

I'm using option 2 that you provided in some old code.

In rather heavy drawings I sometimes get the error: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Explanation: the server hits 100% CPU utilization, and after several seconds falls to about 20%, but the _zoom e command is never finished, and the batch job fails.

Do you think that the error can be prevented by using option 1? - Since I have no ways of reproducing, I hope you might can help me.

Best regards
Peter Elkjaer
Message 7 of 8
Anonymous
in reply to: Anonymous

Hello Peter,

Using SendCommand in VBA and SendStringToExecute in .Net are not supposed for Batch Processes, they are chances that it may fail in long run. I think using Option 1 is always a better idea.

Regards,
Basha
Message 8 of 8
Anonymous
in reply to: Anonymous

Hi Basha.

Thank you for your quick reply, I'll rewrite my code, and see if the unprovoked errors will go away.

/Peter

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