Author Topic: Layer filter delete guidance needed....  (Read 3857 times)

0 Members and 1 Guest are viewing this topic.

diarmuid

  • Bull Frog
  • Posts: 416
Layer filter delete guidance needed....
« 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
If you want to win something run the 100m, if you want to experience something run a marathon

ronjonp

  • Needs a day job
  • Posts: 7463
Re: Layer filter delete guidance needed....
« Reply #1 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")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

deegeecees

  • Guest
Re: Layer filter delete guidance needed....
« Reply #2 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.

diarmuid

  • Bull Frog
  • Posts: 416
Re: Layer filter delete guidance needed....
« Reply #3 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
If you want to win something run the 100m, if you want to experience something run a marathon

ronjonp

  • Needs a day job
  • Posts: 7463
Re: Layer filter delete guidance needed....
« Reply #4 on: August 28, 2007, 12:10:01 PM »
Look above....you probably have to add (c:layerfilterdelete) to the end of it to run.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Crank

  • Swamp Rat
  • Posts: 1492
Re: Layer filter delete guidance needed....
« Reply #5 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.
Vault Professional 2022     +     AEC Collection

diarmuid

  • Bull Frog
  • Posts: 416
Re: Layer filter delete guidance needed....
« Reply #6 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
If you want to win something run the 100m, if you want to experience something run a marathon

CaddmannQ

  • Swamp Rat
  • Posts: 1327
  • Leadsled
Re: Layer filter delete guidance needed....
« Reply #7 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.

CADaver

  • Guest
Re: Layer filter delete guidance needed....
« Reply #8 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.

CaddmannQ

  • Swamp Rat
  • Posts: 1327
  • Leadsled
Re: Layer filter delete guidance needed....
« Reply #9 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.

Crank

  • Swamp Rat
  • Posts: 1492
Re: Layer filter delete guidance needed....
« Reply #10 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:
Vault Professional 2022     +     AEC Collection