Thread Content
It often happens that when you open an AutoCAD drawing just to take a look, you need to use the mouse wheel to zoom in and out. As a result, when you exit CAD, it asks whether you want to save the changes, which is quite annoying. CAXA Electronic Drawing Board does not have this problem. Is there anyone who can write a LISP program or use some other method to change this situation?
Save with z+space+e+space; no scaling will be needed when opening it later. Last edited by leonnie on 2009-2-5 11:17.]
I’m not quite sure; please explain in more detail. Thank you very much
(vl-load-com) (setq *acad* (vlax-get-acad-object)) (setq *doc* (vlax-get-property *acad* 'ActiveDocument)) (defun c:0 () (command "quit" "n")) Enter 0 and press Enter to exit without saving! ! !
Your drawing methods aren’t very standardized. What I mean is, after drawing, display the image in full screen and then save it – that’s how to do it properly. Saving preserves the final state of the image; when you open it again, it will be displayed in full screen. It’s very simple; don’t change anything – it’s a matter of good drawing habits. For the drawings that others give you, you can also save them after viewing the entire image; this way, there’s no need to worry about such things
The problem is that one has to zoom in on a certain part in order to view it
You didn’t understand what LZ meant at all; don’t draw conclusions rashly! ! ! This post was last edited by aicr317 on 2009-2-5 12:58.]
I also feel that the gentlemen here haven’t fully understood what I meant
You can use the things I share with complete confidence; they were all written by me and tested in practice to ensure they work before being shared – they weren’t copied from anywhere else!
What you mean, as I understand it, is: you just want to open and view a certain image, and while viewing it it’s inevitable to use the mouse to zoom in on or out from certain areas. As a result, even if you don’t perform any other actions, when you click to close the window in the top right corner, the system will ask whether you want to save it! You just want, after pressing close, not to see this prompt but to exit directly (without saving)! My programs may not be great, but my language skills are solid, haha! Joking!
Actually, the method (function) you mentioned requires only double-clicking the middle button of the mouse (the scroll wheel), or adding the “Full Image” command to the toolbar and clicking on it – it’s very convenient.
This understanding is also entirely my own idea; thank you.
(defun c:go123( ) ;This program is used to exit CAD without prompting for a save; use it with caution to avoid losing your work. (command "quit" "n" "n") ) (prompt "It was drawn by Dragon! Enjoy it!”) Okay. Here, go123 is the name of the command; you can choose any name as long as it follows the naming rules and does not duplicate an existing command. Usage: 1. Type the above text into Notepad and save it as a go123.lsp file. 2. Locate the acad.mnl file; by default, it is installed in Application Data\Autodesk\AutoCAD 200i\Support. Of course, you can move this file to your own CAD directory as well. 3. Copy the go123.lsp file you created into the Support directory of ACAD; if the path already points to your directory, then it’s not necessary to copy it there. Add the following text to acad.mnl. ( if (null C:go123) (load \"go123\") (princ) ); Loads and executes the go123 command from the written go123.lsp file. Disadvantage: This method does not prompt you to save before exiting; if you have multiple drawings open, they will all be exited without being saved. So be careful when using it so as not to waste your effort. Be cautious. Don’t say I didn’t warn you! (Actually, it’s still recommended to exit by using: z+space+e+space, and then exit.) This post was last edited by fl202 on 2009-2-5 at 14:31.]