Jump to content

Recommended Posts

Posted

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?

Posted

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?

Posted

You being from Norway, I just assume you like sandwiches :thumbsup:

Posted
You being from Norway, I just assume you like sandwiches :thumbsup:
OK, Tiger, please explain that bit of profiling.
Posted

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.

Posted

Thanks for the culture lesson. If I eat sandwiches, I usually eat as much in sandwiches as I would for any other meal.

Posted

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

Posted
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! :D

Posted

Blackbox, thank you for your input, I will sure check those options out.

Posted

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

Posted

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.

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