Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Purge & Audit all drawing files in a folder

  1. #11
    Member
    Join Date
    2006-08
    Location
    Glasgow
    Posts
    11
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    I use Hurricane for most batch scripting. Comes with quite a few basic lisps/scripts.

    http://www.74mph.com/

    Crackin wee program.

  2. #12
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    scriptpro was written by autodesk (hasn't been updated in years, but still works, except for plotting on versions after 04 or 05).

  3. #13
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    Quote Originally Posted by alanjt View Post
    scriptpro was written by autodesk (hasn't been updated in years, but still works, except for plotting on versions after 04 or 05).
    last I heard, it doesnt work for 64bit AutoCAD.

  4. #14
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    Quote Originally Posted by ccowgill View Post
    last I heard, it doesnt work for 64bit AutoCAD.
    yeah, it was written for the 32 bit age. i wasn't even thinking about that (we're still running 32 bit machines, so i still act like a caveman).
    worth mentioning though and thank for the info.

  5. #15
    Member
    Join Date
    2005-10
    Posts
    6
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    this is great when turning over CAD files to another company, but would it be posible to also add something to Convert all Dynamic blocks to anonymous blocks which will disable the Dynamic features.

    Example I found:

    Code:
    (defun c:ConvertDyn	(/ actDoc)
        (vl-load-com)
        (setq actDoc
    	     (vla-get-ActiveDocument
    		 (vlax-get-acad-object)
    	     ) ;_ end_vla-get-ActiveDocument
        ) ;_ end_setq
        (vla-startundomark actDoc)
        (foreach x (vl-remove-if
    		   'listp
    		   (mapcar 'cadr (ssnamex (ssget "x" '((0 . "INSERT")))))
    	       ) ;_ end_vl-remove-if
    	(if (equal (vla-get-IsDynamicBlock (vlax-ename->vla-object x))
    		   :vlax-true
    	    ) ;_ end_equal
    	    (vla-ConvertToAnonymousBlock (vlax-ename->vla-object x))
    	) ;_ end_if
        ) ;_ end_foreach
        (vla-endundomark actDoc)
        (princ)
    
    ) ;_ end_defun
    
    ;;(princ "\nType ConvertDyn in command line to start lisp")
    Last edited by Opie; 2009-09-22 at 01:13 PM. Reason: [code] tags added

  6. #16
    Member
    Join Date
    2009-07
    Posts
    45
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    Quote Originally Posted by renmanz View Post
    this is great when turning over CAD files to another company, but would it be posible to also add something to Convert all Dynamic blocks to anonymous blocks which will disable the Dynamic features.

    Example I found:

    Code:
    (defun c:ConvertDyn	(/ actDoc)
        (vl-load-com)
        (setq actDoc
    	     (vla-get-ActiveDocument
    		 (vlax-get-acad-object)
    	     ) ;_ end_vla-get-ActiveDocument
        ) ;_ end_setq
        (vla-startundomark actDoc)
        (foreach x (vl-remove-if
    		   'listp
    		   (mapcar 'cadr (ssnamex (ssget "x" '((0 . "INSERT")))))
    	       ) ;_ end_vl-remove-if
    	(if (equal (vla-get-IsDynamicBlock (vlax-ename->vla-object x))
    		   :vlax-true
    	    ) ;_ end_equal
    	    (vla-ConvertToAnonymousBlock (vlax-ename->vla-object x))
    	) ;_ end_if
        ) ;_ end_foreach
        (vla-endundomark actDoc)
        (princ)
    
    ) ;_ end_defun
    
    ;;(princ "\nType ConvertDyn in command line to start lisp")
    Well... that code only accepts vla commands... lisp commands can be added to a batch process trough another lisp... I personally can do it now by using the Batch.lsp and and 2 other lisp files, 1 for your process and 1 for loading your first lisp, a starting script may help you adding orders to your lisp and then you can go trough many files and convert all dynamic blocks to annonymous.. need more help? let me know.

  7. #17
    Active Member krushert's Avatar
    Join Date
    2002-12
    Location
    Portland, Maine
    Posts
    58
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    Quote Originally Posted by kpblc2000 View Post
    Based on http://www.autocad.ru/cgi-bin/f1/board.cgi?t=31023zx and http://www.autocad.ru/cgi-bin/f1/board.cgi?t=28195cT :
    Code:
    ;|
    Based on CADALYST 03/05 Tip2023: PurgeFiles.lsp  Directory Clean Up  (c) Andrzej Gumula
      [c]2004 Andrzej Gumula, Katowice, Poland
      e-mail: a.gumula@wp.pl
    |;
    
    (vl-load-com)
    (defun dofile (curdoc)
      (vla-put-activelayer curdoc (vla-item (vla-get-layers curdoc) "0"))
      (vl-catch-all-apply '(lambda () (vla-zoomall (vlax-get-acad-object))))
      (repeat 4 (vla-purgeall curdoc))
      ) ;_ end of defun
    
    (defun c:dofile (/ fileslist subdir files file)
    
    < snip>
    
      ) ;_ end of defun
    (prompt "\n===To start press DOFILE within command prompt===")
    (princ)
    Auditing won't works using ObjectDBX interface.
    For Some reason, this code is not allowing me to use any Lisp commands after the this routine finishes. I can use core commands no problem.
    I am getting this at the command line.
    AecRcpLispSupport::getArgIgnore() got null."

  8. #18
    Active Member
    Join Date
    2006-05
    Location
    Pind
    Posts
    80
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    Using the same routine can i put one function which can collect all the xref attached to all the drawings and write it to a text file.
    the function is given below also tell me where to add this function.
    thanks

    Code:
    (defun C:Get_Xref_Paths (/ fopen outputfile jbActiveDoc)
    (vl-load-com)  
    (defun *error*(msg)(if fopen (close fopen)))
      
    ;;;; Creat the Drectory if it do not exist 
    (if (not (vl-file-directory-p "D:\\CAD_Xref_Files\\"))(vl-mkdir "D:\\CAD_Xref_Files\\"))
    
    (setq outputfile (strcat "D:\\CAD_Xref_Files\\" "Xref_Dwgs_Path" ".txt"))
    (if (findfile outputfile)
        (setq fopen (open outputfile "a"))
        (setq fopen (open outputfile "w"))
        )
    (setq jbActiveDoc (vlax-get-property (vlax-get-acad-object) 'activedocument))
    (vlax-for X (vla-get-blocks jbActiveDoc)(if (= (vlax-get-property X "IsXRef") :vlax-true)
    (write-line (vla-get-path X) fopen)))
    (write-line "-------------------" fopen)
    (close fopen)
    ;(startapp "notepad.exe" outputfile)
    (princ)
      )
    Last edited by Opie; 2010-04-28 at 01:32 PM. Reason: [code] tags added

  9. #19
    Woo! Hoo! my 1st post
    Join Date
    2017-09
    Posts
    1
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    Quote Originally Posted by gilsoto13 View Post
    It needed the audit command, so I added it, check above code

    (vla-AuditInfo File T)
    OLD thread I know, I wonder if anyone has a way to alter this lisp so that if it comes across a drawing that needs recovering it either ignores it or recovers and carries on? Many thanks

  10. #20
    Member
    Join Date
    2016-04
    Location
    Pune, Maharashtra, India
    Posts
    5
    Login to Give a bone
    0

    Default Re: Purge & Audit all drawing files in a folder

    Hi,

    Can following things happen by editing your code?
    1. Open Files from given folder
    2. Purge All
    3. Save in same folder where it was opened from.
    4. Close
    All these function are done in one folder in desired location which is awesome lisp.
    I just want to add few more commands into LISP and the order of Command should be:
    1. Open Files from given folder.
    2. Go to Model.
    3. Turn off Grid.
    4. Zoom Extend.
    5. Come back to Layout.
    6. Purge all.
    7. Save in same folder where it was opened from.
    8. Close.
    Can Anyone help me in this? I am short in learning LISP programming. Please help me with all 12 steps in one code?

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Purge + Audit &/or Recover + Purge
    By Wish List System in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2013-06-20, 08:18 PM
  2. Purge + Audit &/or Recover + Purge
    By Wish List System in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2013-06-19, 07:12 PM
  3. 2012: Purge/Zoom Extents/Qsave a folder of DXF files
    By boyerd492098 in forum AutoCAD General
    Replies: 1
    Last Post: 2012-12-19, 08:39 AM
  4. Purge and/or Audit multiple files?
    By Maverick91 in forum CAD Management - General
    Replies: 5
    Last Post: 2010-07-13, 08:41 PM
  5. Replies: 3
    Last Post: 2006-08-04, 07:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •