本帖最后由 lishucheng96 于 2016-8-5 13:53 编辑
- (DEFUN CHATTRIB (OLDATT NEWATT)
- (IF (AND (PRINC "\nSelect Block with attribute 选择带属性图块 :")
- (SETQ SS (SSGET '((0 . "INSERT") (66 . 1))))) (PROGN
- (SETQ I -1)
- (REPEAT (SSLENGTH SS)
- (SETQ ENT (ENTGET (SSNAME SS (SETQ I (1+ I))))
- ENT1 ENT)
- (WHILE (= (CDR (ASSOC 0 (SETQ ENT1 (ENTGET (ENTNEXT (CDR (ASSOC -1 ENT1))))))) "ATTRIB")
- (IF (= (CDR (ASSOC 1 ENT1)) OLDATT) (PROGN
- (SETQ ENT1 (SUBST (CONS 1 NEWATT) (ASSOC 1 ENT1) ENT1))
- (ENTMOD ENT1)
- (ENTMOD ENT)
- ))
- )
- )
- ))
- (PRINC)
- )
- (DEFUN C:A11 (/ input)
- (setq input (getstring "\输入b1/b2<b1>:"))
- (if (= input "")
- (setq input "b1")
- )
- (IF (= input "b1")
- (SETQ OATT "ABC" NATT "123")
- (SETQ NATT "ABC" NATT "456")
- )
- (CHATTRIB OATT NATT)
- (PRINC)
|