(defun c:QW(/ x x1 x2 t nn ) (prompt "\n Select On Layer:") (setq x (ssget)) (setq i 0) (setq x1 (entget (ssname x i))) (setq x2 (assoc 8 x1)) (command "layer" "off" "*" "y" ) (command "on" (cdr x2)) (setq i 1) (setq t (sslength x)) (setq nn (- t 1)) (repeat nn (setq x1 (entget (ssname x i))) (setq x2 (assoc 8 x1)) (command "on" (cdr x2) ) (setq i (+ i 1)) ) (command "" ) ) ;Y2 ****** explore layout dwg to parts dwg (defun c:Y2() (princ "\n\n") (setq e1 (getstring "\n\n\n INPUT THE PATH FOR BLOCKS TO BE WRITTEN : ")) (setq x (getint "\n FROM LAYER (No) :")) (setq x1 (getint "\n TO LAYER (No) :")) (setvar "cmdecho" 0) (command "_filedia" "0") (command "layer" "t" "*" "") (setq i x) (repeat (+ (- x1 x) 1) (setq e2 (strcat e1 "\\000" (itoa i))) (if (> i 9) (setq e2 (strcat e1 "\\00" (itoa i))) ) (if (> i 99) (setq e2 (strcat e1 "\\0" (itoa i))) ) (command "clayer" i) (command "layer" "f" "*" "") (command "select" "all" "") (command "wblock" e2 "" "0,0" "p" "") (command "oops") (setq i (+ 1 i)) (command "layer" "t" i "") ) (command "_filedia" "1") (command "layer" "t" "*" "") ) ;--------------------------------------------- ;Y3****** wblock a part (defun c:Y3() (princ "\n\n") (setq e1 "H:\\SLOT\\B-LOCK\\PARTS") (setq i (getint "\n INPUT THE LAYER NUMBER TO BE WRITTEN :")) (command "layer" "t" "*" "") (setq e2 (strcat e1 "\\000" (itoa i))) (if (> i 9) (setq e2 (strcat e1 "\\00" (itoa i))) ) (command "_filedia" "0") (command "clayer" i) (command "layer" "f" "*" "") (command "select" "all" "") (command "wblock" e2 "" "0,0" "p" "") (command "oops") (command "layer" "t" "*" "") (command "_filedia" "1") )
|