马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun PutIndexColor ( e col / enx )
- (and
- (eq 'ENAME (type e)) (eq 'INT (type col)) (<= 0 col 256)
- (setq enx (vl-remove-if (function (lambda (x) (= 420 (car x)))) (entget e))) ; remove the true color if present
- (or
- (and (assoc 62 enx) (entmod (subst (cons 62 col) (assoc 62 enx) enx)))
- (entmod (append enx (list (cons 62 col))))
- )
- )
- )
测试命令:
- (defun c:tt (/ CNT DXDT DXFDNEW DXFNEW DXFOLD ENT SSET )
- (command "_.Layer" "_Make" "L-ANNO_TEXT" "_Color" "7" "" "_LType" "Continuous" "" "")
- (setq sset (ssget "_:L"))
- (setq cnt 0)
- (repeat (sslength sset)
- (setq ent (ssname sset cnt))
- (setq dxdt (entget ent))
- (setq dxfold (assoc 8 dxdt))
- (setq dxfnew '(8 . "L-ANNO_TEXT"))
- (setq dxfdnew (subst dxfnew dxfold dxdt))
- (entmod dxfdnew)
- (setq cnt (1+ cnt))
- (PutIndexColor ent 256)
- )
- (princ)
- )
|