;;——————————————————————-
(defun C:1 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "L-DIE" "")
(princ)
);defun
;;——————————————————————-
(defun C:2 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "L-DIE-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:3 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "U-DIE" "")
(princ)
);defun
;;——————————————————————-
(defun C:4 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "U-DIE-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:5 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "PAD" "")
(princ)
);defun
;;——————————————————————-
(defun C:6 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "PAD-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:7 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "L-STEEL" "")
(princ)
);defun
;;——————————————————————-
(defun C:8 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "L-STEEL-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:9 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "U-STEEL" "")
(princ)
);defun
;;——————————————————————-
(defun C:0 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "U-STEEL-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:- (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "CAM" "")
(princ)
);defun
;;——————————————————————-
(defun C:= (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "CAM-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C: (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "CAM-UNIT" "")
(princ)
);defun
;;——————————————————————-
(defun C:12 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "HEEL" "")
(princ)
);defun
;;——————————————————————-
(defun C:13 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "HEEL-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:14 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "POST" "")
(princ)
);defun
;;——————————————————————-
(defun C:15 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "POST-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:16 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "PART" "")
(princ)
);defun
;;——————————————————————-
(defun C:17 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "PART-NO" "")
(princ)
);defun
;;——————————————————————-
(defun C:18 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "PANEL" "")
(princ)
);defun
;;——————————————————————-
(defun C:19 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "PANEL-VIEW" "")
(princ)
);defun
;;——————————————————————-
(defun C:20 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "SECHION" "")
(princ)
);defun
;;——————————————————————-
(defun C:21 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "SECHION-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:23 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "AUTO" "")
(princ)
);defun
;;——————————————————————-
(defun C:24 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "AUTO-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:25 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "AIR" "")
(princ)
);defun
;;——————————————————————-
(defun C:26 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "DIM" "")
(princ)
);defun
;;——————————————————————-
(defun C:27 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "DIM-H" "")
(princ)
);defun
;;——————————————————————-
(defun C:28 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "CENTER" "")
(princ)
);defun
;;——————————————————————-
(defun C:29 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "CORE" "")
(princ)
);defun
;;——————————————————————-
(defun C:30 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "STD" "")
(princ)
);defun
;;——————————————————————-
(defun C:31 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "STD-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun C:32 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "STD1" "")
(princ)
);defun
;;——————————————————————-
(defun C:34 (/ ENT)
(setvar "cmdecho" 0)
(command "layer" "m" "STD1-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:11 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "L-DIE" "")
(princ)
);defun
;;——————————————————————-
(defun c:22 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "L-DIE-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:33 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "U-DIE" "")
(princ)
);defun
;;——————————————————————-
(defun c:44 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "U-DIE-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:55 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "PAD" "")
(princ)
);defun
;;——————————————————————-
(defun c:66 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "PAD-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:77 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "L-STEEL" "")
(princ)
);defun
;;——————————————————————-
(defun c:88 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "L-STEEL-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:99 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "U-STEEL" "")
(princ)
);defun
;;——————————————————————-
(defun c:00 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "U-STEEL-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:– (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "CAM" "")
(princ)
);defun
;;——————————————————————-
(defun c:== (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "CAM-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c: (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "CAM-UNIT" "")
(princ)
);defun
;;——————————————————————-
(defun c:122 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "HEEL" "")
(princ)
);defun
;;——————————————————————-
(defun c:133 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "HEEL-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:144 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "POST" "")
(princ)
);defun
;;——————————————————————-
(defun c:155 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "POST-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:166 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "PART" "")
(princ)
);defun
;;——————————————————————-
(defun c:177 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "PART-NO" "")
(princ)
);defun
;;——————————————————————-
(defun c:188 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "PANEL" "")
(princ)
);defun
;;——————————————————————-
(defun c:199 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "PANEL-VIEW" "")
(princ)
);defun
;;——————————————————————-
(defun c:200 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "SECHION" "")
(princ)
);defun
;;——————————————————————-
(defun c:211 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "SECHION-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:233 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "AUTO" "")
(princ)
);defun
;;——————————————————————-
(defun c:244 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
299 (command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "AUTO-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:255 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "AIR" "")
(princ)
);defun
;;——————————————————————-
(defun c:266 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "DIM" "")
(princ)
);defun
;;——————————————————————-
(defun c:277 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "DIM-H" "")
(princ)
);defun
;;——————————————————————-
(defun c:288 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "CENTER" "")
(princ)
);defun
;;——————————————————————-
(defun c:299 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "CORE" "")
(princ)
);defun
;;——————————————————————-
(defun c:300 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "STD" "")
(princ)
);defun
;;——————————————————————-
(defun c:311 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "STD-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:322 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "STD1" "")
(princ)
);defun
;;——————————————————————-
(defun c:344 (/ ss)
(setvar "cmdecho" 0)
(setq ss (ssget))
(command "change" ss "" "p" "c" "bylayer" "lt" "bylayer" "la" "STD1-DASH" "")
(princ)
);defun
;;——————————————————————-
(defun c:EL(/ ip ent)
(graphscr)
(setvar "cmdecho" 0)
(setq 1 "l-die"
2 "l-die-dash"
3 "u-die"
4 "u-die-dash"
5 "pad"
6 "pad-dash")
(setq ip (getreal "1,2,3,4,5,6, @ Eress하고픈 LAYER 이름이 뭐여 ?:"))
(if (eq ip 1)(setq ip "l-die"))
(if (eq ip 2)(setq ip "l-die-dash"))
(if (eq ip 3)(setq ip "u-die"))
(if (eq ip 4)(setq ip "u-die-dash"))
(if (eq ip 5)(setq ip "pad"))
(if (eq ip 6)(setq ip "pad-dash"))
(setq ent (ssget (list (cons 8 ip))))
(command "ERASE" ent "")
(princ)
);defun
;;——————————————————————-
제가 쓰고자하는 레이어들입니다.
원 레이어명은 제가 일하는 설계명들입니다.
그리고 현제는 CADMAX라는 프로그램으로 현레벨(레이어)를 사용하고요.
일본일을 하면서 데이터 인터패이스에 문제가 만더군요.
그들은 LT 를 쓰고 있거든요.
그래서 acad로 바꿀려고 하다 보니까 이런 문제가 있더군요.
현 레이어명으로 그대로 사용하면서 작업을 할때는 간단하게 할려고합니다.
시삽님 보시고 많은 조언을 부탁드립니다.
;;——————————————————————-
(defun c:CL(/ ip ent)
(setvar "cmdecho" 0)
(setq ip (getstring "1,2,3,4,5,6,7,8,9,0,-,=,,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,34, @ COPY하고픈 LAYER 이름이 뭐여 ?:"))
(setq ent (ssget (list (cons 8 ip))))
(command "COPY" ent "")
(princ)
);defun
;;——————————————————————-
시삽님 보시고 검토를 부탁드립니다!
공유
헐~~~~~~~ 넘 수고가 많으시네여^^ 이렇게 까지 리습을 짜다니..대단하심다..
노력의 승리 같네여 ㅋㅋㅋ
틀린곳만 체크 해드리겠음다…
먼저 윗부분은 틀린곳이 없는 것 같구여..윗부분 쓰시느라 고생했음다..
(defun c:EL(/ ip ent)
(graphscr)
(setvar "cmdecho" 0)
;(setq 1 "l-die" ============> 요기 부터
; 2 "l-die-dash"
; 3 "u-die"
; 4 "u-die-dash"
; 5 "pad"
; 6 "pad-dash") ===========> 요까지 필요 없는 부분임다..
if 문에서 다시 정의를 하기땜시 필요 없음다,..글고 setq 로는 숫자를 함수로 사용못함..
(setq ip (getreal "1,2,3,4,5,6, @ Eress하고픈 LAYER 이름이 뭐여 ?:"))
(if (eq ip 1)(setq ip "l-die"))
(if (eq ip 2)(setq ip "l-die-dash"))
(if (eq ip 3)(setq ip "u-die"))
(if (eq ip 4)(setq ip "u-die-dash"))
(if (eq ip 5)(setq ip "pad"))
(if (eq ip 6)(setq ip "pad-dash"))
(setq ent (ssget <<"x">> (list (cons 8 ip)))) =====>그리고 이곳에 "x" 가빠졌네여<< >> 는 안들어가는 거 아시죠?..
(command "ERASE" ent "")
(princ)
);defun
;;——————————————————————-
;;——————————————————————-
(defun c:CL(/ ip ent)
(setvar "cmdecho" 0)
(setq ip (getstring "1,2,3,4,5,6,7,8,9,0,-,=,,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,34, @ COPY하고픈 LAYER 이름이 뭐여 ?:"))
(setq ent (ssget (list (cons 8 ip))))
(command "COPY" ent "")
(princ)
);defun
그리고 뒷부분에 짜신 리습은 전체적으로 마니 틀리네여.. ip에 문자열을 받아 들인다고 치고
만약에 1를 선택했다면..
그럼 ent 값은 (list (cons 8 "1") 이런식이 되는 거죠
먼가 쫌 이상하지 안나여?…. 그리고 CL리습도 EL 리습처럼 정의 해서 짜야 되여
좀더 실력이 쌓아 진다면 다른방법도 있긴한데..아직까지 그런것을 기대하긴..쫌.
리습안에서 다른 리습을 불러 사용하는 방법인데…. 앞으로도 공부 열심히
하세여………그럼 존하루 제가 오늘은 쫌 바뻐서리..^^
빌린인생님의 답변이 정확하군요~