+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Forum Newbie
    Discipline
    Construction
    Using
    AutoCAD 2018
    Join Date
    Jan 2018
    Posts
    5

    Default How to delete Multiple cad files using excel

    Registered forum members do not see this ad.

    I have about 13000 drawings in my project folder and sub folders, now i got a list of around 2000 drawings to be deleted from our project folder as these will be revised and contractor will resubmitted with new Revision. i want to delete these files from my project folder and by searching manually and deleting is very tedious and time consuming job, any one has or could help me creating VBA to delete these files using Excel list or any other option suggested will be highly appropriated.

    Many Thanks in advance.

  2. #2
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,135

    Default

    I would never delete a file unless you are prepared to work 24 hours a day to replace the one you accidently erased. It would be way smarter to copy somewhere as say \Superceded projects\2018. back them all up 1st on to more than 1 device.

    Dont need a VBA just plain excel get it create a batch file each line is a file to delete. Just copy the column to NOTEPAD and save as say mymove.BAT file run it from Windows command line, bottom left of windows screen.

    del C:\myprojects\job123\1234546.dwg
    del C:\myprojects\job123\1789456.dwg
    del C:\myprojects\job123\123????6.dwg

    You can also do a MOVE its a suppported operting system call for files.

    move C:\myprojects\job123\1234546.dwg C:\myprojects\job123\Jan2018
    move C:\myprojects\job123\1789456.dwg C:\myprojects\job123\Jan2018
    move C:\myprojects\job123\123????6.dwg C:\myprojects\job123\Jan2018
    A man who never made mistakes never made anything

  3. #3
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2018
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,115

    Default

    I'm with BIGAL on this one DO NOT delete, there is no undo in a batch file or in VBA, it doesn't matter how certain you are that your code is correct, do not delete or rename in whole live folders. Doing something like this you should always run it first on a copy of the whole directory structure if need be copy the whole drive. and use the move command (I'd even be cautious with move) then once you have checked the results very carefully and only then, delete the folders with the moved files. And keep the copy of the original layout for as long as possible just in case you find a problem later.
    I've just been down graded from 2012LT to full Autocad 2017. I WANT LT BACK

  4. #4
    Super Moderator Cad64's Avatar
    Computer Details
    Cad64's Computer Details
    Operating System:
    Windows 7 Profesional x64
    Computer:
    XI Computers
    Motherboard:
    Asus P8Z77-V Pro
    CPU:
    Intel Core I7 3770K 4.1 Ghz Quad Core 3rd Gen
    RAM:
    24GB DDR3 @ 1333MHz
    Graphics:
    Nvidia GeForce GTX 570 1280MB GDDR5
    Primary Storage:
    SATAII 500GB 7200 RPM
    Secondary Storage:
    Western Digital My Book Studio Edition II - 2TB capacity
    Monitor:
    HPf2105 21" LCD Widescreen & Cintiq 21ux
    Discipline
    Multi-disciplinary
    Cad64's Discipline Details
    Occupation
    Freelance Digital Artist
    Discipline
    Multi-disciplinary
    Details
    3D model building, texturing and rendering. Photoshop Color Graphics.
    Using
    AutoCAD 2014
    Join Date
    Feb 2006
    Location
    Southern California
    Posts
    10,234

    Default

    This is actually a very dangerous game to play. Automatic deletion of files can go very wrong, very quickly. Also, as mentioned before, you really shouldn't delete old or obsolete files. You never know if or when you might need them again. Move them to another folder until the project is completed, then, if you're absolutely sure you don't need them anymore, you can delete them.
    CGSociety Portfolio: http://rdeweese.cgsociety.org/
    Facebook:
    https://www.facebook.com/rdeweese67/


    "Work Smart, Not Hard"

  5. #5
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,135

    Default

    Moderator please merge with other post they are basicly the same sort of question and the other post is the answer to the delete or my preference a MOVE.

    Replace "copy" in guptil post with MOVE.
    A man who never made mistakes never made anything

  6. #6
    Forum Newbie
    Discipline
    Construction
    Using
    AutoCAD 2018
    Join Date
    Jan 2018
    Posts
    5

    Default

    @ BIGAL Thanks for your comment and advice, actually i have all the files stored on EDMS (Aconex) as well as i have Exe. files saved as a backup, however its very important for other users if they want to use this code.

    Regarding code, i can delete/move the files if they are in one directory but in my case my files are under many different sub folders like,

    P:\1-As Built\AC03\000\CV\DR\Drawings\XX-YYY-CVDR-P-276XXXX-10001-1
    P:\1-As Built\AC03\010\CS\DP\Drawings\XX-YYY-CSDP-P-276XXXX-10005-0
    P:\1-As Built\AC03\010\AR\AW\Drawings\XX-YYY-ARAW-P-276XXXX-10008-0

    What changes we have to make in code?

  7. #7
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,721

    Default

    Awwww....go ahead and delete them. What possible harm could it do? You really don't expect anyone down the road to ask to see one of these drawings do you?

    Or you can take the approach...better safe than sorry. Given the low cost of storage these days what would be the harm in retaining them?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  8. #8
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,135

    Default

    Registered forum members do not see this ad.

    If files are all over the place then you need to go back to a line by line approach, you say there in excel if it has the paths set then its easy, if not you will have to add the paths then move copy delete your choice.

    Support on-site problem
    Brand new Pc is not working, Murphys law if its going to break does so in 1st week.
    Client I have done a lot of work
    Oh you have a tape back drive thats great !!!
    Client never backed anything up
    Very expensive a weeks worth of work do it all again
    Our warranty fix PC not your work.
    A man who never made mistakes never made anything

Similar Threads

  1. Replies: 2
    Last Post: 7th Aug 2017, 12:46 pm
  2. Is there Layer State Manager for importing LAS files into multiple files?
    By kili in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 8th Mar 2014, 12:55 am
  3. Plotting multiple DWG files to multiple PDFs automatically
    By dflynn3386 in forum AutoCAD Beginners' Area
    Replies: 4
    Last Post: 31st Jan 2013, 12:44 pm
  4. Call multiple .scr files from list to create new AutoCad files
    By northcoastrat in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 2nd Dec 2012, 12:50 am
  5. Delete and Excel Xref
    By 99zizzer in forum Map 3D
    Replies: 1
    Last Post: 27th Jan 2012, 05:15 pm

Bookmarks

Posting Permissions

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