Lệnh mở khóa tất cả các layer
kycuckeo 2
biết vẽ circleThành viên 235 bài bác viếtGiới tính:MaleVị trí:TPHCMSở thích:Thiết kế, âm nhạc, thể thao.
Có thể mình không biết hết ý các bạn nhưng các bạn hãy tìm câu vấn đáp trong lisp này:
;;=======================================================================================================;; si mê dao nguoc tinh trang cua cac lop THAWFREE(defun C:revla ()(setq La (tblnext "layer" t))(setq lname (cdr (assoc 2 la)))(setq fr (cdr (assoc 70 la)))(setq on (cdr (assoc 62 la)))(command ".layer")(cond ((= (strcase lname) (strcase (getvar "clayer"))) (progn(princ " Can"t không tính phí current layer") ;;(if (> on 0) (command "off" lname "Y") (command "on" lname) ) )) (T (progn (if (= fr 0) (command "f" lname) (command "t" lname) ) ;;(if (> on 0) (command "off" lname) (command "on" lname) ) )));;; kết thúc cond(setq la (tblnext "layer"))(while la(setq lname (cdr (assoc 2 la)))(setq fr (cdr (assoc 70 la)))(setq on (cdr (assoc 62 la)))(cond ((= (strcase lname) (strcase (getvar "clayer"))) (progn (princ " Can"t không tính phí current layer") ;;(if (> on 0) (command "off" lname "Y") (command "on" lname) ) )) (T (progn (if (= fr 0) (command "f" lname) (command "t" lname) );;(if (> on 0) (command "off" lname) (command "on" lname) ) )));;; over cond(setq La (tblnext "layer")));;; end while(command "")(princ));;=======================================================================================================;;Ham dao nguoc tinh trang cua cac lop ONOFF(defun C:revla1 ()(setq La (tblnext "layer" t))(setq lname (cdr (assoc 2 la)))(setq fr (cdr (assoc 70 la)))(setq on (cdr (assoc 62 la)))(command ".layer")(cond ((= (strcase lname) (strcase (getvar "clayer"))) (progn ;;(princ " Can"t free current layer")(if (> on 0) (command "off" lname "Y") (command "on" lname) ) )) (T (progn ;; (if (= fr 0) (command "f" lname) (command "t" lname) ) (if (> on 0) (command "off" lname) (command "on" lname) ) )));;; kết thúc cond(setq la (tblnext "layer"))(while la(setq lname (cdr (assoc 2 la)))(setq fr (cdr (assoc 70 la)))(setq on (cdr (assoc 62 la)))(cond ((= (strcase lname) (strcase (getvar "clayer"))) (progn ;;(princ " Can"t không tính tiền current layer") (if (> on 0) (command "off" lname "Y") (command "on" lname) ) )) (T (progn;;(if (= fr 0) (command "f" lname) (command "t" lname) ) (if (> on 0) (command "off" lname) (command "on" lname) ) )));;; over cond(setq La (tblnext "layer")));;; end while(command "")(princ));;=======================================================================================================; -------------------- ISOLATE LAYER FUNCTION --------------------(Defun C:LAYISO (/ SS CNT LAY LAYLST VAL VPMODE) (acet-error-init(list (list "cmdecho" 0"expert" 0 ) T;flag.
Bạn đang xem: Lệnh mở khóa tất cả các layer
True means use undo for error clean up.);list );acet-error-init (if (and (= 0 (getvar "tilemode")) ; if in a paper space (/= 1 (getvar "cvport")) ; viewport )(setq VPMODE T) ; phối flag for viewport behavior ) (if (not (setq SS (ssget "_i")))(progn (prompt " Select object(s) on the layer(s) lớn be isolated: ") (setq SS (ssget))) ) (if SS(progn (setq CNT 0) (while (and ss (> (sslength ss) 0) (setq LAY (ssname SS CNT)) );and(setq LAY (cdr (assoc 8 (entget LAY))))(if (not (member LAY LAYLST)) (setq LAYLST (cons LAY LAYLST)))(setq CNT (1+ CNT)) ) (cond(VPMODE (command "_.vplayer" "_freeze" "*" "_Current") (foreach VAL LAYLST (command "_Thaw" VAL "_Current")) (command "") (if (= (length LAYLST) 1)(prompt (acet-str-format " Layer %1 has been isolated in this viewport." (car LAYLST)))(prompt (acet-str-format " %1 layers have been isolated in this viewport." (itoa (length LAYLST)))) ))(T (if (member (getvar "CLAYER") LAYLST)(setq LAY (getvar "CLAYER"))(setvar "CLAYER" (setq LAY (last LAYLST))) ) (command "_.-LAYER" "_OFF" "*" "_Y") (foreach VAL LAYLST (command "_ON" VAL)) (command "") (if (= (length LAYLST) 1)(prompt (acet-str-format " Layer %1 has been isolated." (car LAYLST)))(prompt (acet-str-format " %1 layers have been isolated. Layer %2 is current." (itoa (length LAYLST)) LAY)) )) )) ) (acet-error-restore) (princ));;=======================================================================================================; -------------------- LAYER FREEZE FUNCTION ---------------------(defun C:LAYFRZ (); --------------------- Error initialization --------------------- (acet-error-init(list (list "cmdecho" 0"expert" 0 ) nil;flag. True means use undo for error clean up.);list );acet-error-init (layproc "frz") (acet-error-restore) (princ));;=======================================================================================================; ---------------------- LAYER OFF FUNCTION ----------------------(defun C:LAYOFF (); --------------------- Error initialization --------------------- (acet-error-init(list (list "cmdecho" 0"expert" 0 ) nil;flag. True means use undo for error clean up.);list );acet-error-init (layproc "off") (acet-error-restore) (princ));;=======================================================================================================; ------------- LAYER PROCESSOR FOR LAYOFF & LAYFRZ --------------(defun LAYPROC ( TASK / NOEXIT OPT BLKLST CNT VPMODE EN PMT ANS LAY NEST BLKLST VPSS); -------------------- Variable initialization ------------------- (setq NOEXIT T) (setq OPT (getenv (strcat "ACET_Lay" TASK))) ; get mặc định option setting (if (not (or (null OPT) (= OPT ""))) (setq OPT (atoi OPT))) (setq CNT 0) ; cycle counter (if (and (= 0 (getvar "tilemode")) ; if in a paper space (/= 1 (getvar "cvport")) ; viewport )(setq VPMODE T) ; set flag for freeze behavior ); ----------------------- Selection Prompt ----------------------- (while NOEXIT(setvar "errno" 7)(while (= (getvar "errno") 7) (setvar "errno" 0) (initget "Options Undo _Options Undo") (cond((= TASK "off") (setq EN (nentsel " Select an object on the layer to be turned off orXem thêm: Kiểu Tóc Cho Người Tóc Mỏng Trán Cao Nam, Khiến Chị Em Ai
True means use undo for error clean up.);list );acet-error-init (setq LAY (entsel " Select an object on the layer lớn be locked: ")) (if LAY(progn (setq LAY (cdr (assoc 8 (entget (car LAY))))) (Command "_.-LAYER" "_LOCK" LAY "") (prompt (acet-str-format " Layer %1 has been locked." LAY ))) ) (acet-error-restore) (princ));;=======================================================================================================; -------------------- LAYER UNLOCK FUNCTION ---------------------(Defun C:LAYULK (/ LAY) (acet-error-init(list (list "cmdecho" 0"expert" 0 ) T;flag. True means use undo for error clean up.);list );acet-error-init (setq LAY (entsel " Select an object on the layer khổng lồ be unlocked: ")) (if LAY(progn (setq LAY (cdr (assoc 8 (entget (car LAY))))) (Command "_.-LAYER" "_UNLOCK" LAY "") (prompt (acet-str-format " Layer %1 has been unlocked." LAY ))) ) (acet-error-restore) (princ));;=======================================================================================================; ---------------------- LAYER ON FUNCTION -----------------------(Defun C:LAYON () (acet-error-init(list (list "cmdecho" 0) nil;flag. True means use undo for error clean up.);list );acet-error-init (Command "_.-LAYER" "_ON" "*" "") (prompt " All layers have been turned on.") (acet-error-restore) (princ));;=======================================================================================================; --------------------- LAYER THAW FUNCTION ----------------------(Defun C:LAYTHW () (acet-error-init(list (list "cmdecho" 0) nil;flag. True means use undo for error clean up.);list );acet-error-init (Command "_.-LAYER" "_THAW" "*" "") (prompt " All layers have been thawed.") (acet-error-restore) (princ));;=======================================================================================================; --------------------- LAYER MATCH FUNCTION ---------------------(Defun C:LAYMCH (/ SS CNT LOOP LAY ANS) (acet-error-init(list (list "cmdecho" 0) T;flag. True means use undo for error clean up.);list );acet-error-init (if (not (setq SS (ssget "_i")))(progn (prompt " Select objects to be changed: ") (setq SS (ssget))) ) (if SS(progn (setq CNT (sslength SS)) (princ (acet-str-format " %1 found." (itoa CNT))) ; Report number of items found (command "_.move" SS ""); filter out objects on locked layers (if (> (getvar "cmdactive") 0) ; if there are still objects left(progn (command "0,0" "0,0") (setq SS (ssget "_p")CNT (- CNT (sslength SS)) ; count them ))(setq SS nil) ; else abort operation ) (if (> CNT 0) ; if items where filtered out(if (= CNT 1) (princ (acet-str-format " %1 was on a locked layer." (itoa CNT) )) ; report it. (princ (acet-str-format " %1 were on a locked layer." (itoa CNT) ))) )) ) (if SS(progn (initget "Type-it _Type-it") (setq LAY (entsel " Select object on destination layer or