zoom extend and save - PLEASE
Hello everyone,This lisp might be very usefull:
I need help with lisp that asking for Current drawing \ All tabs
the default should be current drawing.
when pressing Enter (for current drawing) the drawing will do Zoom Extend - save the drawing - and close the drawing.
when pressing A (for all tabs) all the drawings in the tabs will be Zoom Extend - save the drawing - and close the drawing.
The purpose of this lisp is to save time by saving and closing the drawing but only after zoom extend it for better preview.
Thank you very much in advance.
Eyal Here is a good zoom extents
;; Zoom extents in All Layouts (excluding Model) ;; Alan J. Thompson (or *Acad* (setq *Acad* (vlax-get-acad-object))) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument *Acad*))) ((lambda (ctab) (foreach layout (layoutlist) (setvar 'ctab layout) (vla-put-mspace *AcadDoc* :vlax-false) (vla-zoomextents *Acad*) ) (setvar 'ctab ctab)) (getvar 'ctab) ) (princ) How do you operate it?
What should I type in the command prompt?
is it ask if I want to save only the current or all the tabs?
Thank you.
If you have a menu or toolbar or macro it then just loads the lisp file and zooms all. If you save it to a Autocad support file directory that you have set like c:\mylisps then its just a case of issuing the commnad to run it. Save it as say zoomalltabs.lsp
menu/toolbar ^c^c^p(load "zoomalltabs")
command line just type (load "zoomalltabs")
make it a defun C:zoomall and autoload then type zoomall at any time.
Current Z E you can not get much simpler I might be looking at this a bit simply, but I use
(defun c:closer() (command "zoom" "all" "zoom" ".95x")) ;;Zooms to 95% of full screen (command "qsave")) ;;saves the drawing (command "close" "y") ;;Closes the drawing)
This is great for a single layout, but the OP needs to do that for either multiple layouts, or different drawing tabs, I am not sure which. Its a simple start though, add in a few lines to switch between tabs and it should be good to go (I don't have a routine that does that handy at the moment, but there should be one that's easy to find) A bit more
(defun c:closer( / ans)(setq ans (getstring "All press A or justfor current "))(if (= ans "") (command "zoom" "all" "zoom" ".95x") ;;Zooms to 95% of full screen (load "zoomalltabs") ) (command "qsave") ;;saves the drawing (command "close" "y") ;;Closes the drawing) BIGAL:
_$ (getstring "All press A or justfor current ") ; enter was pressed"" Grr your right thanks, changed to "" sometimes just write without testing properly as I used getstring ais not a nil answer. Changed code above, I cheated also press any key but left it as "A" in message.
(setq ans (getstring "All press A or justfor current "))(if (= ans "")(alert " pressed")(alert "non nil"))
页:
[1]
2