e61 Posted August 29, 2013 Posted August 29, 2013 Hi all.. My projects consist of drawings with this naming style: Bxxxx.dwg (main drawing) Bxxxx-xx.dwg (sub drawings) where x is numeric 0-9. After the project is done, I run a LSP that finds, and opens each sub drawing in the project in turn, then purge all, then save/close. The Q is, is it possible to have a LSP that purge all without open each and every sub drawing? Quote
Tiger Posted August 29, 2013 Posted August 29, 2013 Since Purge is a command that runs inside the drawing, I doubt it. But if you have a script for it, can't you set that in motion and go get a sandwich or something? Quote
e61 Posted August 29, 2013 Author Posted August 29, 2013 Sandwich.. good idea. Thanks for input. Quote
Tiger Posted August 29, 2013 Posted August 29, 2013 You being from Norway, I just assume you like sandwiches Quote
neophoible Posted August 29, 2013 Posted August 29, 2013 You being from Norway, I just assume you like sandwiches OK, Tiger, please explain that bit of profiling. Quote
Tiger Posted August 29, 2013 Posted August 29, 2013 Haha I realise that sounds a bit weird. Swedes eat about as much for lunch as they do for dinner. Norweigans eat sandwiches for lunch. It's a bit of a culture clash. Quote
neophoible Posted August 29, 2013 Posted August 29, 2013 Thanks for the culture lesson. If I eat sandwiches, I usually eat as much in sandwiches as I would for any other meal. Quote
BlackBox Posted August 29, 2013 Posted August 29, 2013 The Q is, is it possible to have a LSP that purge all without open each and every sub drawing? To a slightly different degree, and with some well written code... Yes. Essentially, you need to prompt the user for a given directory, see if there are drawings in that folder, interface with ObjectDBX, iterate the list of drawings checking that each is unopened, then open them as a DBX Document, and proceed to iterate a list of each collection object you want to 'clean', and then iterate each collection object itself using a call to (vl-Catch-All-Apply 'vla-Delete (list x)). Some available collection objects you might be interested in specifically are: Blocks, DimStyles, Layers, Linetypes, Materials, PlotConfigurations, RegisteredApplications, TextStyles, and Views, etc. As a small demonstration of some of this functionality, here's a Batch Find Surface routine which queries a directory of Drawings, and generates a report if any Civil 3D Surfaces are found. Cheers Quote
BlackBox Posted August 29, 2013 Posted August 29, 2013 Thanks for the culture lesson. If I eat sandwiches, I usually eat as much in sandwiches as I would for any other meal. ... God bless America... Me too! Quote
BlackBox Posted August 29, 2013 Posted August 29, 2013 You could always purchase Owen's SuperPurge as well. Quote
e61 Posted August 30, 2013 Author Posted August 30, 2013 Blackbox, thank you for your input, I will sure check those options out. Quote
troggarf Posted August 30, 2013 Posted August 30, 2013 You can try Script_Pro and the script provided in the following post: http://adndevblog.typepad.com/autocad/2012/04/batch-purging-of-drawing-files-using-scriptpro-20.html To use an option where AutoCAD doesn't open for each drawing, I would suggest looking into having Script_Pro open the "Core Console" instead or AutoCAD. I made a post about how to do so here: http://www.cadtutor.net/forum/showthread.php?76974-Up-and-Running-with-the-2013-Core-Console&highlight=core+console ~Greg Quote
Enigma Posted August 30, 2013 Posted August 30, 2013 Or just purge all everytime you think you are done the individial drawing. If you have to edit it later, all you have to do is insert your template, cancel it, and viola! All your pre-purge info is back. Quote
Recommended Posts
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.