JPlanera Posted December 22, 2011 Posted December 22, 2011 I am sure there is a much simpler way to do this, but it works and thats all that matters, right? I always need to pull certain parts of a drawing out into a new file and to avoid all the copy clip open paste..... i created a program to do it for me. It uses 2 different LISPS and a script file.. (Again, im sure there is an easier way...) This is the main code... ; THIS COMMAND WILL SAVE A SELECTED PORTION OF A ; ; DRAWING TO A NEW FILE AND OPEN THE SAVE AS DIALOG BOX ; ; CREATED BY JPLANERA ; (DEFUN C:ssome ( / sset BP) (setq sset (ssget)) (princ "\n...Select base point:") (setq BP (getpoint)) (command "copyclip" sset "") (command "script" "M:\\ENGR\\DRAWINGS\\AUTOCAD SETTINGS\\SCRIPTS\\OPEN_NEW_PASTECLIP.SCR") (princ)) This part of the code I auto load with the startup of AutoCAD (defun c:ssomesave (/ FN) (setq FN (getfiled "Save Drawing As" "" "dwg" 1)) (if (= FN nil ) (progn (princ)(princ "...SAVEAS ABORTED...")(princ)) (progn (setvar "cmdecho" 0) (command "saveas" "" FN "y")(princ)))) And here is the script file... NEW pasteclip 0,0 zoom extents ssomesave I hope someone else finds this usefull, and of course, if it can be improved... bring it on! :-) Quote
fixo Posted December 22, 2011 Posted December 22, 2011 Thanks for sharing works like a charm for me (tested on 2009) Just one thing I want to suggest pehaps would be good to display alert message in case you want to save a file with existing name in this folder In this case you may loss this existing drawing Thanks, Regards ~'J'~ 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.