"This is your brain on --SHELL"

Discussion in 'AutoCAD' started by ryan nodurft, Aug 12, 2004.

  1. ryan nodurft

    ryan nodurft Guest

    I am trying to do this:
    c:\....\...\...>dir /s/b *.dwg> dwglist.txt
    It works when entered in MS-DOS, but I can't get it to work through autocad's "shell" command.
    Can someone explain the difference, if any exist, between the "shell" command and MS-DOS.
    After learning how to use MS-DOS through the windows help files, my brain Is about as done as the egg on the, "This is your brain on drugs" commercial.
    Any help would be very appreciated!!
     
    ryan nodurft, Aug 12, 2004
    #1
  2. ryan nodurft

    Tom Smith Guest

    Try putting the DOS command in quotes (command "shell" "dir /s /b *.dwg >
    dwglist.txt")
     
    Tom Smith, Aug 12, 2004
    #2
  3. ryan nodurft

    spencer1971 Guest

    http://nonags.siol.net/fileu32.html

    I do not know if this helps (not if you are programming) but if you dowload filename x from the above site it will automate what you are doing in shell. Its freeware and creates lists of files etc. through windows,

    Spence
     
    spencer1971, Aug 12, 2004
    #3
  4. ryan nodurft

    Jürg Menzi Guest

    Hi ryan

    (command "_.SHELL" "DIR C:\\MyDwgs\\*.dwg /s/b > C:\\MyDwgs\\dwglist.txt")

    Cheers
     
    Jürg Menzi, Aug 12, 2004
    #4
  5. Are you entering it when AutoCAD prompts you for the "OS Command:"? If so,
    try the command in double quotes like this:

    "dir /s/b *.dwg > dwglist.txt"

    If you ignore the AutoCAD prompt and hit Enter again, the command line
    window should appear.
    I tried entering
    dir /s/b *.dwg>dwglist.txt
    at the command line, and the file "dwglist.txt" did list the dwg files in
    the current directory and its subdirectories.

    Good luck,

    -Rick Francken

    autocad's "shell" command.
     
    Rick Francken, Aug 12, 2004
    #5
  6. ryan nodurft

    RYAN NODURFT Guest

    Thanks for the great response everyone!!!!!!
    I can now make a .txt of my dwg folder!!!!
     
    RYAN NODURFT, Aug 12, 2004
    #6
  7. ryan nodurft

    GaryDF Guest

    oops forgot the bat files

    create a bat file called: DWG_FULL_PATH_LIST.bat

    MKDIR C:\DWG_List
    MKDIR C:\Batch
    DIR *.DWG/B/S > "C:\Batch\PLOT.Q"
    DIR *.DWG/B > "C:\DWG_List\DWG_List.txt"
    DIR *.DWG/B/S > "C:\DWG_List\DWG_Full_Path_List.txt"
    NOTEPAD "C:\DWG_List\DWG_Full_Path_List"



    create a bat file called: DWG_LIST.bat

    MKDIR C:\DWG_List
    MKDIR C:\Batch
    DIR *.DWG/B/S > "C:\Batch\PLOT.Q"
    DIR *.DWG/B/S > "C:\DWG_List\DWG_Full_Path_List.txt"
    DIR *.DWG/B > "C:\DWG_List\DWG_List.txt"
    NOTEPAD "C:\DWG_List\DWG_List.txt"


    "GaryDF"
     
    GaryDF, Aug 12, 2004
    #7
  8. How about something like this? (I can't stand
    that dos window popping up)

    ; quickie to write drawing file names from
    ; a folder to a user specified file.
    ; very little (read basically none) error checking.
    ; could be modified to work on sub folders also.
    ; modify as required to suite your needs.

    (defun c:dwgsToFile (/ folder dwgs target file)
    (setq folder (BrowseForFolder)) ; thanks for that, Tony
    (if
    (and
    folder
    (setq dwgs (vl-directory-files folder "*.dwg" 1))
    (setq target (getfiled "specify a target file" "dwgFiles" "txt" 1))
    (setq file (open target "w"))
    )
    (progn
    (write-line folder file)
    (foreach item dwgs (write-line (vl-filename-base item) file))
    (close file)
    )
    )
    (startapp "notepad.exe" target)
    (princ)
    )

    ; Tony Tanzillo
    (defun BrowseForFolder ( / sh folder folderobject result)
    (vl-load-com)
    (setq
    sh
    (vla-getInterfaceObject
    (vlax-get-acad-object)
    "Shell.Application"
    )
    )

    (setq
    folder
    (vlax-invoke-method
    sh
    'BrowseForFolder
    0
    "test"
    0
    )
    )
    (vlax-release-object sh)

    (if folder
    (progn
    (setq
    folderobject
    (vlax-get-property folder 'Self)
    )
    (setq
    result
    (vlax-get-property FolderObject 'Path)
    )
    (vlax-release-object folder)
    (vlax-release-object FolderObject)
    result
    )
    )
    )


    --
    Autodesk Discussion Group Facilitator


    brain Is about as done as the egg on the, "This is your brain on drugs"
    commercial.
     
    Jason Piercey, Aug 12, 2004
    #8
  9. ryan nodurft

    GaryDF Guest

    Very nice

    Gary


     
    GaryDF, Aug 12, 2004
    #9
  10. wow, nice selection! Glad I checked that link

    spencer1971 <>
    |>http://nonags.siol.net/fileu32.html
    |>
    |>I do not know if this helps (not if you are programming) but if you dowload filename x from the above site it will automate what you are doing in shell. Its freeware and creates lists of files etc. through windows,
    |>
    |>Spence

    James Maeding
    Civil Engineer/Programmer
     
    James Maeding, Aug 13, 2004
    #10
  11. now make that work recursive and I'll be interested.
    I can't seem to get anything but a dos "DIR *.dwg /s >file.txt"
    thx

    "Jason Piercey" <JasonATatrengDOTcom>
    |>How about something like this? (I can't stand
    |>that dos window popping up)
    |>
    |>; quickie to write drawing file names from
    |>; a folder to a user specified file.
    |>; very little (read basically none) error checking.
    |>; could be modified to work on sub folders also.
    |>; modify as required to suite your needs.
    |>
    |>(defun c:dwgsToFile (/ folder dwgs target file)
    |> (setq folder (BrowseForFolder)) ; thanks for that, Tony
    |> (if
    |> (and
    |> folder
    |> (setq dwgs (vl-directory-files folder "*.dwg" 1))
    |> (setq target (getfiled "specify a target file" "dwgFiles" "txt" 1))
    |> (setq file (open target "w"))
    |> )
    |> (progn
    |> (write-line folder file)
    |> (foreach item dwgs (write-line (vl-filename-base item) file))
    |> (close file)
    |> )
    |> )
    |> (startapp "notepad.exe" target)
    |> (princ)
    |> )
    |>
    |>; Tony Tanzillo
    |>(defun BrowseForFolder ( / sh folder folderobject result)
    |> (vl-load-com)
    |> (setq
    |> sh
    |> (vla-getInterfaceObject
    |> (vlax-get-acad-object)
    |> "Shell.Application"
    |> )
    |> )
    |>
    |> (setq
    |> folder
    |> (vlax-invoke-method
    |> sh
    |> 'BrowseForFolder
    |> 0
    |> "test"
    |> 0
    |> )
    |> )
    |> (vlax-release-object sh)
    |>
    |> (if folder
    |> (progn
    |> (setq
    |> folderobject
    |> (vlax-get-property folder 'Self)
    |> )
    |> (setq
    |> result
    |> (vlax-get-property FolderObject 'Path)
    |> )
    |> (vlax-release-object folder)
    |> (vlax-release-object FolderObject)
    |> result
    |> )
    |> )
    |> )

    James Maeding
    Civil Engineer/Programmer
     
    James Maeding, Aug 13, 2004
    #11
  12. ryan nodurft

    BTO Guest

    or using acet-ui-pickdir : Express Tools function.

    (if (setq path (acet-ui-pickdir "Select a folder" "C:\\"))
    (setq list_files_sorted (acad_strlsort (vl-directory-files path "*.dwg")))
    )

    Bruno Toniutti
     
    BTO, Aug 20, 2004
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...