21
155
135
初露锋芒
((= optn 1) (done_dialog) (setq ent (car (entsel)) filt (list (assoc 0 (entget ent))) itm (cdr(assoc 0 (entget ent)))) (cond (= itm "ATTDEF") (setq itm "ATTRIBUTE") (= itm "INSERT") (setq itm "BLOCK") (= itm "MLINE") (setq itm "MULTILINE") (= itm "LWPOLYLINE") (setq itm "POLYLINE") (= itm "XLINE") (setq itm "CONSTRUCTION LINE"))(setq txt (strcat itm " Entity(s)")) )
((= optn 51) (done_dialog) (setq ent (car (entsel)) filt (list (assoc 8 (entget ent))) itm (cdr(assoc 8 (entget ent))) txt (strcat "Layer " itm " items")))
使用道具 举报
1505
1551
(defun c:Select_Items ( / dcl_id *error* ent filt itm optn ss txt ) (defun *error* ( msg ) (princ "error: ") (princ msg) (princ) );;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun doButton (optn) (cond ((= optn 1) (done_dialog) (setq ent (car (entsel)) filt (list (assoc 0 (entget ent))) itm (cdr(assoc 0 (entget ent)))) (cond (= itm "ATTDEF") (setq itm "ATTRIBUTE") (= itm "INSERT") (setq itm "BLOCK") (= itm "MLINE") (setq itm "MULTILINE") (= itm "LWPOLYLINE") (setq itm "POLYLINE") (= itm "XLINE") (setq itm "CONSTRUCTION LINE"))(setq txt (strcat itm " Entity(s)")) )((= optn 2) (setq filt '((0 . "ATTDEF")) txt "ATTRIBUTE Entity(s)") (done_dialog) ) ((= optn 3) (setq filt '((0 . "INSERT")) txt "BLOCK Entity(s)") (done_dialog) ) ((= optn 4) (setq filt '((0 . "LINE")) txt "LINE Entity(s)") (done_dialog) ) ((= optn 5) (setq filt '((0 . "LWPOLYLINE")) txt "POLYLINE Entity(s)") (done_dialog) ) ((= optn 6) (setq filt '((0 . "*TEXT")) txt "TEXT and/or MTEXT Entity(s)") (done_dialog) ) ((= optn 51) (done_dialog) (setq ent (car (entsel)) filt (list (assoc 8 (entget ent))) itm (cdr(assoc 8 (entget ent))) txt (strcat "Layer " itm " items"))) ((= optn 52) (setq filt '((8 . "DIMENSIONS")) txt "items on layer DIMENSIONS") (done_dialog) ) ((= optn 53) (setq filt '((8 . "NO PRINT")) txt "items on layer NO PRINT") (done_dialog) ) ((= optn 54) (setq filt '((8 . "PCAB")) txt "items on layer PCAB") (done_dialog) ) ((= optn 55) (setq filt '((8 . "SCREEN")) txt "items on layer SCREEN") (done_dialog) ) ((= optn 56)(setq filt '((8 . "TEXT")) txt "items on layer TEXT") (done_dialog) ) );; end cond);; end (defun doButton (optn) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if(not(setq dcl_id (load_dialog (findfile "Select_Items.dcl")))) ;;;--- Load the dcl file from disk into memory (progn ;; progn1 (alert "The DCL file could not be loaded.") (exit) );; end progn1 ;;;--- Else, the file was loaded (progn;; progn2 ;;;--- Load the dialog definition inside the DCL file (if (not (new_dialog "Select_Items" dcl_id)) (progn (alert "The Select_Items definition could not be found in the DCL file!") (exit) ) ;;;--- Else, the definition was loaded (progn ;; progn3 ;;;--- If an action event occurs, do this function (action_tile "1" "(done_dialog 1)") (action_tile "2" "(done_dialog 2)") (action_tile "3" "(done_dialog 3)") (action_tile "4" "(done_dialog 4)") (action_tile "5" "(done_dialog 5)") (action_tile "6" "(done_dialog 6)") (action_tile "51" "(done_dialog 51)") (action_tile "52" "(done_dialog 52)")