need lisp to CREATE layer filters

156 views
Skip to first unread message

Rhots

unread,
Jan 26, 2005, 3:11:21 PM1/26/05
to
Hi folks,
I am using Robert Bell's LFD to clean up my layer filters but I would like to be able to run a second lisp automatically to create a few for or office. I followed all 125 links for "layer filter" and found one by Kojacek but it would not run. It worked with a text file list.of the required filters.
I am using acad2002/adt3.3 on win 98. I have VERY limited knowledge of lisp so it needs to be pretty much DUH proof.
Thanks for any help.
Rick

Warren Trost

unread,
Jan 27, 2005, 8:51:40 AM1/27/05
to
I posted a message on 10-13-04 in the autodesk.autocad.2005 discussion group
of how to do this.

"Rhots" <nos...@address.withheld> wrote in message
news:3788944.110677031...@jiveforum1.autodesk.com...

GaryDF

unread,
Jan 27, 2005, 9:28:08 AM1/27/05
to
This is what I use:

(defun Make_Layer_Filterit (/ FILTLST LFILTOBJ SAFECODE SAFEFILT)
(vl-load-com)
(setq FILTLST (list
;;name Lay col lt flags lw plot
(list "Arch..Detail" "A-DETL*" "*" "*" 0 "*" "*")
(list "Arch..Annotation" "*NOTE*" "*" "*" 0 "*" "*")
(list "Arch..Dimensions" "*DIMS*" "*" "*" 0 "*" "*")
(list "Arch..Symbols" "*SYM*" "*" "*" 0 "*" "*")
(list "Arch..Sheet" "*WSHTT*" "*" "*" 0 "*" "*")

(list "Eng...Civil" "C-*" "*" "*" 0 "*" "*")
(list "Eng...Structural" "S-*" "*" "*" 0 "*" "*")
(list "Eng...Mechanical" "M-*" "*" "*" 0 "*" "*")
(list "Eng...Electrical" "E-*" "*" "*" 0 "*" "*")
(list "Eng...Plumbing" "P-*" "*" "*" 0 "*" "*")
)
LFILTOBJ (vla-addobject
(vla-GetExtensionDictionary
(vla-Get-Layers
(vla-Get-ActiveDocument
(vlax-Get-Acad-Object)
)
)
)
"ACAD_LAYERFILTERS"
"AcDbDictionary"
)
SAFECODE (vlax-make-safearray 2 '(0 . 6))
SAFEFILT (vlax-make-safearray 12 '(0 . 6))
)
(vlax-safearray-fill SAFECODE (list 1 1 1 1 70 1 1))
(foreach
SUBLST FILTLST
(vlax-safearray-fill
SAFEFILT
(mapcar '(lambda (X) (vlax-make-variant X 8)) SUBLST)
)
(vla-addxrecord LFILTOBJ (nth 0 SUBLST))
(vla-setxrecorddata
(vla-item LFILTOBJ (nth 0 SUBLST))
SAFECODE
SAFEFILT
)
)
(prin1)
(princ "\n* All Layer Filters have been created........... *")
)

Gary


"Rhots" <nos...@address.withheld> wrote in message
news:3788944.110677031...@jiveforum1.autodesk.com...

Rhots

unread,
Jan 31, 2005, 10:28:21 AM1/31/05
to
Thanks Gary, works great. I had to add a "c:" after defun to get it to work.
Thanks again.
Warren, the one you posted was the one I tried before that wouldn't work for me.
Thanks for the replys guys.
Rick
Reply all
Reply to author
Forward
0 new messages