Jump to content

LISP request


dbroada

Recommended Posts

I feel a bit of a fraud as this is the sort of thing I should be able to myself however I'm lazy/busy today so wonder if somebody could do it for me/has something already.

 

I would like a LISP or similar that could run through a given directory and output to a text file the drawing name and the ACXXXX version number. We have some drawings that are not being saved correctly and I would like to identify where they are before I batch change everything to the correct version.

 

TIA

Link to comment
Share on other sites

Hi Dave,

 

Try this:

(defun c:dwgver ( / des dir lst out vrs )
   (if (setq dir (LM:browseforfolder "" nil 512))
       (if (setq lst (vl-directory-files dir "*.dwg" 1))
           (if
               (and
                   (setq out (vl-filename-mktemp "ver" (getvar 'dwgprefix) ".txt"))
                   (setq des (open out "w"))
               )
               (progn
                   (foreach dwg lst
                       (if (setq vrs (LM:dwgversion (setq dwg (strcat dir "\\" dwg))))
                           (write-line (strcat dwg "\t" vrs) des)
                           (write-line (strcat dwg "\tUnknown") des)
                       )
                   )
                   (close des)
                   (startapp "notepad" out)
               )
               (princ "\nUnable to create Output file.")
           )
           (princ "\nNo Drawings found in selected directory.")
       )
       (princ "\n*Cancel*")
   )
   (princ)
)
(vl-load-com) (princ)

The above requires the following functions to be loaded:

 

Browse for Folder

Drawing Version

Link to comment
Share on other sites

Excellent as usual Lee. It looks like I have to "convert" 80% back to 2010. Might as well do the lot.....

Link to comment
Share on other sites

  • 2 years later...
Hi..can i ask you knowledge regarding LISP command. please.. i want to learn. thanks

 

Ask away - but if your question is not related to the topic of this thread, then it belongs in a new thread.

 

thanks a lot for sharing Lee!

this will be very beneficial :)

 

You're most welcome! I'm delighted that others can make use of it :)

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