class="answer-text mb-10 "> 需要修改圖形的顏色為"Bylayer"即【圖層顏色】。 我一般使用小程式修改圖層及顏色。 autolisp小程式的程式碼如下: ;;; 修改圖層;;;; (defun C:XG ( / k1 kw1 ob1 tc1) (setvar "cmdecho" 0) (setvar "blipmode" 0) (if (null vlax-dump-object) (vl-load-com) ) (if (setq tc1 (entsel "\n請選擇參考圖層或預設為當前圖層")) (setq tc1 (cdr (assoc 8 (entget (car tc1))))) (setq tc1 (getvar "clayer")) ) (if (setq kw1 (ssget)) (progn (while (setq k1 (ssname kw1 0)) (setq kw1 (ssdel k1 kw1)) (setq ob1 (vlax-ename->vla-object k1)) (vla-put-layer ob1 tc1) (vla-put-color ob1 256) );while ) ) (princ) )
class="answer-text mb-10 "> 需要修改圖形的顏色為"Bylayer"即【圖層顏色】。 我一般使用小程式修改圖層及顏色。 autolisp小程式的程式碼如下: ;;; 修改圖層;;;; (defun C:XG ( / k1 kw1 ob1 tc1) (setvar "cmdecho" 0) (setvar "blipmode" 0) (if (null vlax-dump-object) (vl-load-com) ) (if (setq tc1 (entsel "\n請選擇參考圖層或預設為當前圖層")) (setq tc1 (cdr (assoc 8 (entget (car tc1))))) (setq tc1 (getvar "clayer")) ) (if (setq kw1 (ssget)) (progn (while (setq k1 (ssname kw1 0)) (setq kw1 (ssdel k1 kw1)) (setq ob1 (vlax-ename->vla-object k1)) (vla-put-layer ob1 tc1) (vla-put-color ob1 256) );while ) ) (princ) )