Author Topic: ZoomExtents question  (Read 3900 times)

0 Members and 1 Guest are viewing this topic.

Proctor

  • Guest
ZoomExtents question
« on: April 03, 2008, 03:52:41 PM »
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

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: ZoomExtents question
« Reply #1 on: April 03, 2008, 08:06:11 PM »
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
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Proctor

  • Guest
Re: ZoomExtents question
« Reply #2 on: April 04, 2008, 01:47:57 PM »
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

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: ZoomExtents question
« Reply #3 on: April 04, 2008, 07:03:36 PM »
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?


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.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Proctor

  • Guest
Re: ZoomExtents question
« Reply #4 on: April 04, 2008, 07:29:12 PM »
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!!!

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: ZoomExtents question
« Reply #5 on: April 04, 2008, 07:36:00 PM »
< .. >
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?

< .. >

I imagine it's being put where you tell it to go.

How did you 'place' it ?

//---

though, if your active space is modelspace, and it's drawn in modelspace, the zoom extents should encompass it.  :|
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.