;;選擇帶屬性圖塊
(setq SNAME (ssname (ssget ":s" '((0 . "INSERT") (66 . 1))) 0))
Dxf 66
變動屬性伴隨旗號(可選擇的;預設值 = 0);若屬性伴隨旗號的值是 1,則插入點後預期會接著一系列屬性元件(由 seqend 元件結束)
seqend元件
標記聚合線頂點(頂點類型名稱)的結尾,或具有屬性值(由 66 群碼表示且在插入圖元中不為 0 )屬性圖元(屬性類型名稱)的結尾。這個碼不會儲存在 DXF 檔案中。
(defun C:SB (/ SLIST SNAME ETBLL SN1 SN1LIST) (princ "\n修改屬性值---VER 1.0。") (setq SNAME (ssname (ssget ":s" '((0 . "INSERT") (66 . 1))) 0)) (if SNAME (progn (command ".undo" "E") (command ".undo" "BE") (setq SN SNAME SNAME (entnext SNAME) ) (setq SN1 (cdr (assoc -2 (tblsearch "block" (cdr (assoc 2 (entget SN)))) ) ) ) (while (/= "SEQEND" (cdr (assoc 0 (setq SLIST (entget SNAME))))) (setq SN1LIST (entget SN1)) (setq VAL (getstring (strcat "\n輸入新的屬性值<<" (cdr (assoc 3 SN1LIST)) "--->" (cdr (assoc 1 SLIST)) ">>:" ) ) ) (setq VAL (if (= VAL "") (cdr (assoc 1 SLIST)) VAL ) ) (setq SLIST (subst (cons 1 VAL) (assoc 1 SLIST) SLIST)) (entmod SLIST) (setq SN1 (entnext SN1)) (setq SNAME (entnext SNAME)) ) (entupd SN) (command ".undo" "E") ) ) (princ) )
|