Author Topic: Zoom and View Control  (Read 1573 times)

0 Members and 1 Guest are viewing this topic.

LSElite

  • Newt
  • Posts: 65
Zoom and View Control
« on: December 01, 2015, 06:47:08 AM »
Hey All

I am doing a bit og jumping around in a drawing while using ssget and it seems selection set retrieval does not work for objects off the screen.
So i have added in an assortment of command calls using zoom to ensure all obejcts are on the screen and of a reasonable zoom to ensure accurate selections.
This appears to have slowed the program down though, I noticed in a post from Lee Mac he used:
(vla-zoomwindow app (vlax-3D-point pt1) (vlax-3D-point pt2))
and
(vla-zoomprevious app)

It seems to me that vla functions achieve this a little faster than command calls, does anyone know of any other efficient functions for moving the view around?

Cheers
“A life spent making mistakes is not only more honorable, but more useful than a life spent doing nothing.”
― George Bernard Shaw

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Zoom and View Control
« Reply #1 on: December 01, 2015, 07:49:57 AM »
Please note that the code I posted in your other thread was only an example to demonstrate the method - in a full application, you would cache the AutoCAD application object in order to avoid repeated calls to (vlax-get-acad-object), which is a relatively slow process.

LSElite

  • Newt
  • Posts: 65
Re: Zoom and View Control
« Reply #2 on: December 01, 2015, 08:14:28 AM »
Cheers Lee, that is handy to know.
I was not aware (vlax-get-acad-object) was slow to run. I will avoid multiple executions from now on. :-D

Keeping with the topic, do have any more hidden gems of knowledge for view and zoom modification?
Punching through the command line seems so clunky, especially when it is being iterated extensively.
“A life spent making mistakes is not only more honorable, but more useful than a life spent doing nothing.”
― George Bernard Shaw