马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
今天晚上,忙里偷闲,写了一段小程序,可以蒙蒙初学者。
使用时注意,我有出现致命错误的情况。

- ;;;加密测试 by LL_J
- (defun c:lk (/ ss count entlist ent blk) ;Lock
- (setq ss (ssget "X"))
- (entmake
- (list '(0 . "BLOCK") '(70 . 1) '(10 0 0 0) (cons 2 "*U"))
- )
- (setq count 0)
- (repeat (sslength ss)
- (setq entlist (entget (setq ent (ssname ss count))))
- (setq count (1+ count))
- (entmake entlist)
- )
- (setq count 0)
- (repeat (sslength ss)
- (setq ent (ssname ss count))
- (setq count (1+ count))
- (entdel ent)
- )
- (setq blk (entmake '((0 . "ENDBLK"))))
- (if blk
- (entmakex
- (list '(0 . "INSERT")
- (cons 2 blk)
- '(100 . "AcDbMinsertBlock")
- '(10 0.0 0.0 0.0)
- '(41 . 1.0)
- '(42 . 1.0)
- '(43 . 1.0)
- '(50 . 0.0)
- '(70 . 0)
- '(71 . 2)
- '(44 . 0.0)
- '(45 . 0.0)
- )
- )
- )
- (princ)
- )
- (defun c:unlk (/ en ent) ;Unlock
- (setq en (entsel "\nSelect Object to Unlock:"))
- (if en
- (if (= (cdr (assoc 0 (setq ent (cdr (entget (setq en (car en)))))))
- "INSERT"
- )
- (progn
- (setq ent (entmakex
- (list '(0 . "INSERT")
- (assoc 2 ent)
- '(10 0.0 0.0 0.0)
- )
- )
- )
- (command "_.explode" (entlast))
- (entdel en)
- )
- )
- )
- (princ)
- )
|