Vijayk Posted March 2, 2023 Posted March 2, 2023 Hi Please can you help on the lisp where i can run one command there it has to use multiple commands and it has to save in dxf r12 version. Need Lisp For ==>Burst==>Overkill==>Purge==> and it has to save in DXF r12 version Thanks in Advance Quote
dan20047 Posted March 2, 2023 Posted March 2, 2023 (edited) You can use script files to combine lisp & command calls. (Not fully tested, just to give the idea.) Syntax based on Bricscad V15 prompts. (LM:burstsel (ssget "X") T) ;make sure burst lisp has been loaded (command "overkill" "all" "" "") ;; repeat as many times as required depending on complexity of nesting _.purge all * n _.purge all * n _.purge all * n (command "saveas" "dxf" "v" "r12" "16" (strcat (getvar "dwgname") "_r12")) Edited March 2, 2023 by dan20047 1 Quote
Vijayk Posted March 3, 2023 Author Posted March 3, 2023 Hi dan20047, Thank you so much for your quick responce. please can you elobarate this bit more? or any refrence for script? i never used the script. Thanks in advance Quote
Steven P Posted March 3, 2023 Posted March 3, 2023 (edited) This is a good reference, http://www.lee-mac.com/tutorials.html#lisptutorials , You'll also need to look here for a sub function LM:burstsel (always a good plan to link where routines are posted): http://lee-mac.com/upgradedburst.html To give a better answer for you, 'I never used script' - do you need a tutorial on creating a script or LISP from nothing, or do you know somethings and just need a bit of guidance for AutoCAD scripts in particular? If you want to use what dan20047 offered as a LISP routine you might want to make it into one, something like: (defun c:boks ( / ) ;Burst OverKill Save ;;Burst all ojects (LM:burstsel (ssget "X") T) ;;http://lee-mac.com/upgradedburst.html ;;Overkill command (command "overkill" "all" "" "") ;; repeat as many times as required depending on complexity of nesting (repeat 3 ;; 3 repeats (command "PURGE" "A" "*" "N") ) ;;save as DXF (command "saveas" "dxf" "v" "r12" "16" (strcat (getvar "dwgname") "_r12")) ) ; end function -EDIT- Should have called this routine BOSs - Burst OverKill Save s, D'Oh! Edited March 3, 2023 by Steven P 1 Quote
dan20047 Posted March 3, 2023 Posted March 3, 2023 Scripts are the most basic way to 'program' CAD. It was what I first started using almost 25 years ago... They are basically just a way of playing back recorded commands/key strokes. But you can also combine them with lisp commands which I what I did in above post. Check out: http://www.lee-mac.com/scriptwriting.html Autodesk: Have You Tried: Streamline Tasks with Scripts One advantage of scripts is that you can often run other special commands that are not as easy to execute with lisp (until you learn more). If you can type it at the command line and it works, then put those commands in a script file to run again later. Back in the day we used them to switch layer setups between plans, reflected ceiling plans, etc. This is before layer states existed. My save as command could have been done with just commands and not lisp, but I wanted to show how to add a prefix to the name. Just the script/command method is: saveas dxf v r12 16 redraw This would be in a file name yourscript.scr which you run by typing SCRIPT and selecting file. I put the redraw command in so that you can easily see there is an extra return which is accepting the default filename from the saveas command. (You'll learn this best by trial and error.) Quote
Steven P Posted March 3, 2023 Posted March 3, 2023 Lisp can be a little quicker to run, fewer key presses than "script" - select file - run or type in "boks" (from mine above) and can be more versatile, able to do anything really that you can type in the command line and more 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.