NineteenHand Posted January 26, 2014 Share Posted January 26, 2014 I recently started work at a firm which uses AutoCAD 2012. Some of the files sizes get huge and it is a problem to send them electronically or plot them. I was given a solution which greatly reduces the file size. The only problem is the time required to go through the process for each drawing. I know a lisp will reduce this time but I am not completely sure how to go about it. I have read through several webpages and many forum posts but was hoping for some input from the community. Here is the process I was given. open dwg command: audit (option: y) command: dxfout (save to desktop) close dwg open dxf command: audit (option: y) command: purge (all) saveas over original dwg with new file close dxf delete dxf I know most (all?) of these processes can be automated. I am very familiar with the c language but I can find a "library"(I know this is not how AutoCAD deals with commands) with a list of commands and the modifiers associated with each. How can I automate the above process so it will execute the above commands on all dwg in a given folder? Thank you for your help and for dealing with another inexperienced lisp request. Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted January 26, 2014 Share Posted January 26, 2014 (edited) I usually use two way to do this task. * ETRANSMIT command. or *write simple script to do this task. Edited January 26, 2014 by mostafa badran Quote Link to comment Share on other sites More sharing options...
CADMASTER1128 Posted January 26, 2014 Share Posted January 26, 2014 I have a LISP program (on my work computer) that I will share tomorrow. Please post a reminder!! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 26, 2014 Share Posted January 26, 2014 Not sure why your making a dxf rather than just purging if you type -purge A this will run a comand mode without any user input. Use a script -purge A N -purge R N Audit Y save Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 27, 2014 Share Posted January 27, 2014 Purge Regapps first then do the purge > all. In my opinion you don't need to do this with a lisp routine. It can be done using a script. Quote Link to comment Share on other sites More sharing options...
CADMASTER1128 Posted January 27, 2014 Share Posted January 27, 2014 I have a LISP program (on my work computer) that I will share tomorrow. Please post a reminder!! Please see the attached LISP like I discussed... I use this everyday at work and it has help my team and I with Fatal Errors (defun C:FIN() (COMMAND "-PURGE" "R" "*" "N" "-PURGE" "A" "*" "N" "_QSAVE" "AUDIT" "Y" "CTAB" "000" "ZOOM" "A" "_QSAVE"))(princ) **Disclaimer: I modified the code from what a Co-Worker gave me, so I do not own the original work.** Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 28, 2014 Share Posted January 28, 2014 Like post above as i suggested use -purge this is a lisp example but you can change it to a script as well and run it over as many drawings as you like just add the open dwgxxx at start. Just me I do a zoom all layout tabs as part of cleaning up, particuarly if you go down the script path, you can also set the final layout to be the first not by name if you want re "000" it does though require about 3 lines of code. (vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))) (if (= 1 (vla-get-taborder lay)) (setvar "ctab" (vla-get-name lay)) ) ; if ) ; for Quote Link to comment Share on other sites More sharing options...
TheyCallMeJohn Posted January 28, 2014 Share Posted January 28, 2014 This is script we use to whip client files before we xref them in. I prefer a script you don't accidentally run it and it is simpler for our staff. model DELETELAYOUTS -xref d * -vports si -view top -scalelistedit R Y E regenall -purge r * n -purge A * N '_snapang 0 zoom e audit y -purge r * n qsave -purge A * N -purge r * n qsave Quote Link to comment Share on other sites More sharing options...
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.