added:
If the variables *acad* or *layouts* were used several times throughout the routine they WOULD be worthwhile saves as local variables. .. BUT not just because of their use in a FOR loop.
Kerry,
Well actually Daron is correct setting the *acad* variable.
(vla-zoomextents *acad*)
Compared to this which gets the acad object on each pass of the vlax-for loop.
(vla-zoomextents (vlax-get-acad-object))
While I'm nit-picking... this also indicates a misunderstanding of what's going on
in a vlax-for or foreach loop.
(defun zoom_all_layouts (/ lay *doc*)
...
(vlax-for lay layouts...
The lay symbol is local to the vlax-for call. Declaring it local to the program is not needed.
I trust ya'll know it's not my intention to offend anyone. I just think when someone says,
"here's a cleand-up version of your code", it implies a lesson to be learned. If it fails
to do that, someone should say so. Otherwise misconceptions are handed down to others who may
take it as gospel.
Regards