Print Page | Close Window

command filter

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=497
Printed Date: 01.Jun.2026 at 02:51


Topic: command filter
Posted By: teo18480
Subject: command filter
Date Posted: 19.Feb.2008 at 09:58
HELLO guys,i want to ask something.i am making a lisp file and i would like to know if there is another way to write the command filter.when i am typing the command a window appears.is there any other way to type it and have something at my command line.here is an example:if i type at command line the command layer ---->a window appear if i type -layer--->i have results at the command line.does anyone know how i can do this with the command filter?thanx



Replies:
Posted By: Arben.Allaraj
Date Posted: 19.Feb.2008 at 12:07
 
 I hope this file will  help you.
 
 ; Makes sure that all dimensions, text, center lines, hidden lines
; and phantom lines are of the correct color and on the correct layer.
; Modify defaults to suit.
(defun C:FL (/ OLAY SS1 SS2 SS3 SS4 SS5)
   (setvar "CMDECHO" 0)
   (setq OLAY (getvar "CLAYER"))
   (command "layer" "m" "dime" "lt" "continuous" "" "c" "yellow" "" "")
   (command "layer" "m" "text" "lt" "continuous" "" "c" "green" "" "")
   (command "layer" "m" "center" "lt" "center" "" "c" "red" "" "")
   (command "layer" "m" "hidden" "lt" "hidden" "" "c" "green" "" "")
   (command "layer" "m" "phantom" "lt" "phantom" "" "c" "white" "" "")
   (prompt "\nChecking Dimensions...")
   (setq SS1 (ssget "X" '((0 . "DIMENSION"))))
   (if SS1
      (command "change" SS1 "" "p" "c" "bylayer" "la" "dime" "lt" "bylayer" "")
   )
   (prompt "\nChecking Text...")
   (setq SS2 (ssget "X" '((0 . "TEXT"))))
   (if SS2
      (command "change" SS2 "" "p" "c" "bylayer" "la" "text" "lt" "bylayer" "")
   )
   (prompt "\nChecking Center Elements...")
   (setq SS3 (ssget "X" '((6 . "CENTER")))) 
   (if SS3
      (command "change" SS3 "" "p" "c" "bylayer" "la" "center" "")
   )
   (prompt "\nChecking Hidden Elements...")
   (setq SS4 (ssget "X" '((6 . "HIDDEN"))))
   (if SS4
      (command "change" SS4 "" "p" "c" "bylayer" "la" "hidden" "")
   )
   (prompt "\nChecking Phantom Elements...")
   (setq SS5 (ssget "X" '((6 . "PHANTOM"))))
   (if SS5
      (command "change" SS5 "" "p" "c" "bylayer" "la" "phantom" "")
   )
   (command "layer" "s" OLAY "")
   (princ)
); end fl.lsp


-------------
Ing Arben.Allaraj
http://cad-drafting-corner.blogspot.com


Posted By: teo18480
Date Posted: 19.Feb.2008 at 18:41
thanx for your reply.i really dont need something like this but i found it very good.do u know if there is a lisp that i can search my drawing for dimensions and then to erase them?i need something like this.filter the dimensions----->erase the dimensions.thanx a lot


Posted By: Arben.Allaraj
Date Posted: 20.Feb.2008 at 11:46

 

 Search to CADALYST WEB.



-------------
Ing Arben.Allaraj
http://cad-drafting-corner.blogspot.com



Print Page | Close Window