请教各位大神有没有办法一次性将普通块变成多重块N次,现在这个代码是来自网上,普通块变成多重块,点一下加一次(变成N次的目的是为了别人在把多重块变成普通块时要破解N次,来增加外发图纸防更改的相对安全性)
- ;普通块转多重块(lockb)
- (DEFUN C:lockb ()
- (setvar "cmdecho" 0)
- (SETQ STM (car (ENTSEL "\n点取块")))
- (while stm
- (setq e (entget stm))
- (setq stlx (cdr (assoc 0 e)))
- (if (= stlx "INSERT")
- (PROGN
- (setq r_zm70 (assoc 70 e))
- (setq c_zm71 (assoc 71 e))
- (setq e (subst (cons 70 1) r_zm70 e))
- (setq e (subst (cons 71 1) c_zm71 e))
- (setq e (subst (list 100 "AcDbMInsertBlock") (list 100 "AcDbBlockReference") e))
- (entmake e)
- (entdel stm)
- ))
- (SETQ STM (car (ENTSEL "\n点取下一块")))
- )
- (setvar "cmdecho" 1)
- )
|