TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: diarmuid on August 28, 2007, 10:55:30 AM

Title: Layer filter delete guidance needed....
Post by: diarmuid on August 28, 2007, 10:55:30 AM
Some advice needed form my learn'd friends

I wish to setup Auotcad (2002 and 2006) to run a lisp routine (a layer filter delete routine) each time people open a drawing.  whihc support file should i alter (acad.lsp for instance) or can i call up a routine or a script from wihtin autocad when a drawing has been opened?

Thanking you guys in advance

Diarmuid
Title: Re: Layer filter delete guidance needed....
Post by: ronjonp on August 28, 2007, 11:00:00 AM
This is what I use in my custom MNL file.
Code: [Select]
(defun rjp-nolayerfilters (dictionary /)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
(vla-GetExtensionDictionary
   (vla-Get-Layers
     (vla-Get-ActiveDocument
       (vlax-Get-Acad-Object)
     )
   )
)
dictionary
       )
     )
  )
  (princ)
)
(rjp-nolayerfilters "AcLyDictionary")
(rjp-nolayerfilters "ACAD_LAYERFILTERS")
Title: Re: Layer filter delete guidance needed....
Post by: deegeecees on August 28, 2007, 11:10:05 AM
For 2002, load it in your acad2002doc.lsp right before the last (princ) actually you can load it anywhere in the file, if you want it to load and run automatically on every drawing opened, regardless of custom menu's and such. Make sure you have a support path pointing to the directory the file resides in.
Title: Re: Layer filter delete guidance needed....
Post by: diarmuid on August 28, 2007, 12:06:53 PM
thanks guys,

this is what i have added to my acad.mnl file

(Load "P:/ACAD/PM/LISP/LayerFiltersDelete.lsp")

thats fine, it loads the routine into memory

now i want to run it, what next?

thanks in advance

Diarmuid
Title: Re: Layer filter delete guidance needed....
Post by: ronjonp on August 28, 2007, 12:10:01 PM
Look above....you probably have to add (c:layerfilterdelete) to the end of it to run.
Title: Re: Layer filter delete guidance needed....
Post by: Crank on August 29, 2007, 03:39:50 PM
Layer filters aren't such a pain any more.
Some people actually use them, so I don't remove all of them without asking any more.
You can use the FILTERS command (note the S) to handle layer filters with care.
Title: Re: Layer filter delete guidance needed....
Post by: diarmuid on August 31, 2007, 04:44:58 AM
thnaks for all the help guys thats helped me out a lot.

unfortunately i must delte all of the filter lists, some of the drawings here have up-to5 mb extra memory taken up because of filter lists.  when i delete them, a file that was 4.5mb is now only 500k. 

thanks again guys

Diarmuid
Title: Re: Layer filter delete guidance needed....
Post by: CaddmannQ on August 31, 2007, 09:57:02 AM
unfortunately i must delte all of the filter lists, some of the drawings here have up-to5 mb extra memory taken up because of filter lists.  when i delete them, a file that was 4.5mb is now only 500k...

This is what I've been running into with drawings from clients, and since we don't use their layers or other setups I've been using a freebie called CDGpurge for some years to trim these drawings (following the normal purge; all.)

Unfortunately the diaglog box would never work once I went to R 2007 on WinXP, so I'm just using the command line version with "all" as the default. One click=no more garbage overhead.

It's a wonder to me why people don't police up their drawings before distribution.
Title: Re: Layer filter delete guidance needed....
Post by: CADaver on August 31, 2007, 12:19:35 PM
It's a wonder to me why people don't police up their drawings before distribution.
Some of them rely on layer filters as a very productive tool for their use.  To them, deleting the filters would be reducing the usefulness of the file.
Title: Re: Layer filter delete guidance needed....
Post by: CaddmannQ on August 31, 2007, 12:33:17 PM
Point taken.

But when the drawings contain generations and generations of garbage,  carried in from every block and entity they ever dropped in from another party's drawing, and multiplied by using one old drawing to create another over and over (instead of starting each one from a refined and dedicated prototype) you know by looking at their drawings that they really have no clue how this works against them.

Since we work (to a degree) from the basis of their electronic files, and they generally do not work from ours, I have no qualms about dumping their ovehead.
Title: Re: Layer filter delete guidance needed....
Post by: Crank on September 04, 2007, 02:09:51 PM
I thought that problem was solved with Acad2006.

If you don't want more than 100 layer filters, the variable LAYERFILTERALERT can help:
(http://www.theswamp.org/screens/Crank/Layerfilteralert.PNG)