;*************************************************************选中线框创建8块模板,原线保留 (defun c:ct2() (setq n -1) (princ "\n选择模板外形") (setq sg_name(ssget)) (setq sl(sslength sg_name)) (princ "\n选择模座外形") (setq sg_name1(ssget)) (setq s2(sslength sg_name1)) (repeat sl (setq n (+ n 1)) (setq es_name(ssname sg_name n)) ;*****Create Layer "D01"创建模板虚拟框 (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" es_name "" "color" "9" "ltype" "center" "layer" "D01" "s" "5" "") ;*****Create Layer "D02" (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" es_name "" "layer" "D02" "" ) ;*****Create Layer "D03" (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" el_name "" "layer" "D03" "" ) ;*****Create Layer "S01" (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" el_name "" "layer" "S01" "" ) ;*****Create Layer "S02" (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" el_name "" "layer" "S02" "" ) ;*****Create Layer "P03" (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" el_name "" "layer" "P03" "" ) ;*****Create Layer "P02" (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" el_name "" "layer" "P02" "" ) ;*****Create Layer "P01"创建模板虚拟框 (command "copy" es_name "" "0,0" "" ) (setq el_name(entlast)) (command "chprop" el_name "" "color" "9" "ltype" "center" "layer" "P01" "s" "5" "") ) ;*****Create Layer "P01、D01" (repeat s2 (setq n (+ n 1)) (setq es_name1(ssname sg_name1 n)) ;*****Create Layer "P01" (command "copy" es_name1 "" "0,0" "" ) (setq el_name1(entlast)) (command "chprop" el_name1 "" "layer" "P01" "") ;*****Create Layer "D01" (command "copy" es_name1 "" "0,0" "" ) (setq el_name1(entlast)) (command "chprop" es_name1 "" "layer" "D01" "") ) (princ) )
|