named layer manager

Hello everyone, Is there anyone out there that has a lisp routine on how to delete all named layer groups under layer manager AutoCAD 2000i thanks DCF

Reply to
Dennis Flandez
Loading thread data ...

This will delete all named layer filters when loaded.

;; Modified by Chip Harper 09/24/03 ;; ;; By R. ROBERT BELL ;; (defun C:LayerFiltersDelete () (vl-Load-Com) (vl-Catch-All-Apply '(lambda () (vla-Remove (vla-GetExtensionDictionary (vla-Get-Layers (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))) "ACAD_LAYERFILTERS"))) (prompt "\n...") (prompt "\n***All layer filters have been deleted!***") (princ) ) (C:LayerFiltersDelete) (princ)

Reply to
WHO

Has anyone got something like this WITHOUT all the VLA-* calls? (IE something that'll work on older versions)

"ACAD_LAYERFILTERS")))

Reply to
Michael Bulatovich

which older versions? AFAIK, versions that can't use vla-* don't have the named layer filters either.....

Jeff

Reply to
Jeff Mishler

In "older versions" you will not find any layer filters ;-)

Juergen

Michael Bulatovich schrieb:

Reply to
Jürgen Palme

What about 14? It came with LMAN, but if I remember correctly, those VLA-* calls weren't supported yet. I may be wrong, I'm a bit fuzzy on those "extended" LISP commands. Once upon a time they were something, they changed them to something else.....

While I'm at it, if anyone could clear up the history of those commands, say with a link, I'd also be grateful.

Reply to
Michael Bulatovich
[ See response to Jeff ]
Reply to
Michael Bulatovich

In Rel. 14 you can create only ONE Layer filter at one time... Or I'm missing something?

Juergen

Michael Bulatovich schrieb:

Reply to
Jürgen Palme

Michael, As Jurgen pointed out, with rel. 14 you can create only one layer filter. You CAN create layer states that are saved to file, but that is not what this thread was referring to, or at least that's what I thought ;-)

Jeff

commands, say

Reply to
Jeff Mishler

So I'm TOTALLY CONFUSED? Sorry. I thought we were talking about a routine to delete those nasty named layer states that can only be selected one at a time for deletion. You were talking about filters applying to the layer dialogues?

Reply to
Michael Bulatovich

No, Jurgen. Ithink I was missing something: the whole point of the thread. See response to Jeff.

Reply to
Michael Bulatovich

And here is a modified version that asks for the names to delete, wildcards are allowed.

Jeff

;;Original code to delete all layer filters by R. Robert Bell. ;;Heavily modified to delete only specific filters by ;;Jeff Mishler, December 2003

(defun c:filtrdel (/ names dicts) (vl-Load-Com) (princ "\nRoutine to delete all but the specified Layer filters. When entering filter names to retain, wildcards are allowed. i.e., entering \"zz*,xx*\" will delete all filters except those beginning with zz and xx.") (setq names (getstring "\nEnter filter names to retain, press Enter for none: ")) (vl-Catch-All-Apply '(lambda () (setq dicts (vla-GetExtensionDictionary (vla-Get-Layers (vla-Get-ActiveDocument (vlax-Get-Acad-Object) ) ) ) ) (vlax-for dict dicts (if (and (= (vla-get-name dict) "ACAD_LAYERFILTERS") (> (vla-get-count dict) 0)) (progn (vlax-for filtr dict (if (not (wcmatch (vla-get-name filtr) names)) (vla-delete filtr) ) ) ) ) ) ) ) (princ "\nSpecified layer filters have been deleted.") (princ) )

"ACAD_LAYERFILTERS")))

Reply to
Jeff Mishler

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.