Author Topic: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD  (Read 2251 times)

0 Members and 1 Guest are viewing this topic.

Sam

  • Bull Frog
  • Posts: 201
HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« on: March 20, 2012, 01:37:06 AM »
Dear all,

HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #1 on: March 20, 2012, 01:56:36 AM »
Where do you get this drawing list? Are you using Sheet Sets? Do you want a list stating all the values from your title blocks (i.e. in excel rather than NotePad)? Or are you only interested in a list of DWG files in a folder?

All those are possible, but each has a different answer. Could you please elaborate?
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Sam

  • Bull Frog
  • Posts: 201
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #2 on: March 20, 2012, 02:28:48 AM »
Where do you get this drawing list? Are you using Sheet Sets? Do you want a list stating all the values from your title blocks (i.e. in excel rather than NotePad)? Or are you only interested in a list of DWG files in a folder?

All those are possible, but each has a different answer. Could you please elaborate?

dear sir,
thx for reply
only interested in a list of DWG files in a folder & subfolder
i create menu with sld lisp required txt file so many block in my folder i don't written all path in text file
D:\Block\Kitchen\Refrigerator\FRIDGE-1
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #3 on: March 20, 2012, 05:11:23 AM »
Look into the vl-directory-files function

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #4 on: March 20, 2012, 07:16:26 AM »
One thread, and there are more just no time to look.
http://www.theswamp.org/index.php?topic=3499.0
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #5 on: March 20, 2012, 07:21:13 AM »
If you really do want them in a text file, then the old DOS command-line may be of service:
  • Open a command console (CMD.exe in windows 7). Press WinKey+R, type cmd & Enter.
  • Browse to the folder using dos command CD (for change directory). This is the hard part  :ugly:
  • Type the DIR command with /B switch to show "bare-bones-list" and wildcard only DWG files. Then redirect the output into a text file. E.g.:
Code: [Select]
DIR /B *.DWG > MyList.txt
If you want each to have the path as well and also have all subfolders under the current, then include the /S switch thus:
Code: [Select]
DIR /B /S *.DWG > MyList.txt
Edit: Nearly forgot, there' is a new thing in Vista & Win7. While browsing to a folder (any explorer window, including acad's open dialog) hold down the Shift button & Right-Click on the folder - you should now have a "Open command window here" option in the popup menu. That way you can omit steps 1 & 2 above.
« Last Edit: March 20, 2012, 07:31:07 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #6 on: March 20, 2012, 07:30:32 AM »
If you really do want them in a text file, then the old DOS command-line may be of service:

1+ much easier than writing a LISP program  :-)

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #7 on: March 20, 2012, 07:35:24 AM »
I'm in agreement there. Unless this folder gets added to constantly, in which case I'd start looking at dynamically creating the menu (but that's a whole other ball game).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #8 on: March 20, 2012, 09:43:07 AM »
Code: [Select]
dir %1 /-p /a /o /b>"%temp%\file list"
notepad "%temp%\file list"
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

deegeecees

  • Guest
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #9 on: March 20, 2012, 11:39:22 AM »
Here's something that may work for you. Study it very carefully.

Code: [Select]
(DEFUN C:dir_list ()

;;;;;;;;;;;;;;;;;;;;;;;;;Select directory to be processed

(setq dfil (getfiled "Select a **FILE** in the directory you want to list, then click on OPEN" "D:/" "*" 0))
(setq wutdir (vl-filename-directory dfil))
(setq wutfiles (vl-directory-files wutdir "*.dwg" 1))
(setq dwglistfile (strcat wutdir "\\dir_list.txt"))
(SETQ dwgfiler (OPEN dwglistfile "w"))
(WRITE-LINE wutdir dwgfiler)

(foreach n wutfiles
(WRITE-LINE n dwgfiler)
(princ)
)
(alert "\n***File DIR_LIST.TXT has been created in the directory you chose.***")
(CLOSE dwgfiler)
(startapp "notepad" dwglistfile)


(princ)


);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DEFUN

Sam

  • Bull Frog
  • Posts: 201
Re: HOW TO WRITE MY DRAWING LIST IN DIRECT NOTEPAD
« Reply #10 on: March 21, 2012, 03:12:55 AM »
Dear all sir,

thx for reply & sorry for delay

lee sir (vl-directory-files) thx for good suggestion
irneb sir look very nice but result not match my lisp
Plankton sir nice code thx  i will study & get back for suggestion thx
cab sir & alanjt also thx

some link found me i archive my list at this software
http://www.infonautics.ch/directorylistprint/
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html