nnutting Posted November 17, 2011 Posted November 17, 2011 Not sure if this would be a script of a lisp...so recommendations please. When trying to exit a single drawing file, I would like the following to happen when I type 'exit' - zoom extents - layer back to '0' - save drawing - close drawing If this would be a script...how do I permenently load a script and make sure it loads everytime I start up CAD? Quote
mdbdesign Posted November 17, 2011 Posted November 17, 2011 Not sure if this would be a script of a lisp... ...and button macro. Let"s experiment... (now your turn) Quote
Tharwat Posted November 17, 2011 Posted November 17, 2011 Try this .... (defun c:MyExit nil ;; Tharwat 18. Nov. 2011 ;; (command "_.zoom" "_extents") (setvar 'clayer "0") (if (eq (getvar 'dwgtitled) 1) (progn (command "_.save" "") (command "_.close" "") ) (alert "Save your drawing first and come back after that !!!" ) ) (princ) ) Quote
BlackBox Posted November 17, 2011 Posted November 17, 2011 Here's a freebie: (defun c:FOO () (vl-load-com) (setvar 'clayer "0") (foreach x '(("._zoom" "extents") ("._qsave") ("._close")) (vl-catch-all-apply 'vl-cmdf x))) Quote
Tharwat Posted November 17, 2011 Posted November 17, 2011 Very nice way of coding Renderman and I missed you a lot buddy . What's if the file is not already saved and does not have a title ? Quote
BlackBox Posted November 17, 2011 Posted November 17, 2011 Very nice way of coding Renderman and I missed you a lot buddy . Thanks Tharwat; yeah it's been a while since I've been able to hang out. I'll try to visit more often. What's if the file is not already saved and does not have a title ? ^^ I'm Clark Gable on this one... "Frank, my dear, I don't give a damn." Quote
Tharwat Posted November 17, 2011 Posted November 17, 2011 ^^ I'm Clark Gable on this one... "Frank, my dear, I don't give a damn." No worries. Cheers ..... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.