Jump to content

Need Lisp For ==>Burst==>Overkill==>Purge==> and it has to save in DXF r12 version


Vijayk

Recommended Posts

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 

Link to comment
Share on other sites

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 by dan20047
  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Steven P
  • Like 1
Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...