Code Red > .NET

ZoomExtents question

(1/2) > >>

Proctor:
Hello: I would like to call zoomExtents after the user selects their image from an opendialog and it gets drawn in model space.

I was looking at posts such as the one below; however, I believe that this does not work w/ the .net api:

AcadApplication pApp;

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

pApp.ZoomExtents();

Thanks for your help,
Proctor

Kerry:
Have you tried the code you posted ?
Or looked at the class browser ?

Rather than use COM, have a look at the this ;
http://www.caddzone.com/CommandLine.cs

which is mentioned here ;
http://www.theswamp.org/index.php?topic=16028.0

Proctor:
Hi Kerry: Thanks for pointing me to the Command Line script.

I ended up using the slightly modified version of it - pulled from:
http://www.theswamp.org/index.php?topic=16028.0
which as pulled from the original version: http://www.caddzone.com/CommandLine.cs

I converted to vb ..and am attaching for anyone who may find use of it.

It works - however - one glitch...if i call ZoomExtents from the command prompt (via   <CommandMethod("TEST")> ), all is great...

but

If I just make a call to it via my sub...i know it's going there because I debugged ....but does nothing...no zoom effect.

any suggestions?

Thanks again for getting me this far.

Proctor

Kerry:
may be an idea to add credits to that code :-)

any particular reason you don't use a namespace in vb ?


//---

--- Quote ---If I just make a call to it via my sub...i know it's going there because I debugged ....but does nothing...no zoom effect.
any suggestions?
--- End quote ---


we'd need to see the calling code I think. (a small self contained compilable class )
I don't 'do' vb, but may recognise something in your code.

Proctor:
Hi Kerry - my appologies...that code is very useful.
I believe Tony Tanzillo is the author of the original (http://www.caddzone.com/CommandLine.cs)

And if I'm correct, you, Daniel and LE put heads together on the modified version (http://www.theswamp.org/index.php?topic=16028.0)

As it turns out, the image was showing up in model space, I just wasnt' seeing it because it get's placed in the coa coa patch (down yonder). I'm wondering how to tell it where it should reside?


Thanks again for all the help.
TGIF!!!

Navigation

[0] Message Index

[#] Next page

Go to full version