明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 8766|回复: 34

锁定图纸,希望不能再编辑

    [复制链接]
发表于 2012-12-4 08:51:09 | 显示全部楼层 |阅读模式
本帖最后由 自贡黄明儒 于 2012-12-4 09:20 编辑

;;有时候,我们并不希望别人修改我们的图纸,说起原因,那就是一段伤心的往事了。
;;今在网上下载了一个程序,试了一下,还行。其原理我不知道。但操作起来很麻烦,得不断
;;回答Yes/No,于是我去掉了许多选项,一键搞定,大家看看这样的修改行不行?
  1. ;;有时候,我们并不希望别人修改我们的图纸,说起原因,那就是一段伤心的往事了。
  2. ;;今在网上下载了一个程序,试了一下,还行。其原理我不知道。但操作起来很麻烦,得不断
  3. ;;回答Yes/No,于是我去掉了许多选项,一键搞定,大家看看这样的修改行不行?
  4. ;;By: John D. Chapman  自贡黄明儒 2012.12.4
  5. (defun C:Lockup (/ CDIA CMD FDIA PROXYS #SPIN)
  6.   ;;1 处理代理
  7.   (defun proxy (/ PLIST SSET WSSET)
  8.     (setq plist '((-4 . "<OR")
  9.     (0 . "ACAD_PROXY_ENTITY")
  10.     (0 . "AECC_*")
  11.     (0 . "AEC_*")
  12.     (0 . "AECS_*")
  13.     (0 . "RTEXT")
  14.     (-4 . "OR>")
  15.    )
  16.     )
  17.     (if (setq sset (ssget "x" plist))
  18.       (goexp sset)   ;爆破代理   
  19.     )
  20.     (if (setq wsset (ssget "x" (list '(0 . "wipeout"))))
  21.       (goerase wsset)
  22.     )
  23.   )
  24.   ;;2 爆破代理
  25.   (defun goexp (sset / CNT)
  26.     (repeat (setq CNT (sslength sset))
  27.       (command "_explode" (ssname sset (setq CNT (1- CNT))))      
  28.       (spin "Exploding..")
  29.     )
  30.   )
  31.   ;;3 删除
  32.   (defun goerase (wsset / WCNT)
  33.     (repeat (setq WCNT (sslength wsset))
  34.       (entdel (ssname wsset (setq WCNT (1- WCNT))))      
  35.       (spin "Erasing..")
  36.     )
  37.   )
  38.   ;;4
  39.   (defun getlayers (/ LAYLIST LYR)
  40.     (while (setq lyr (tblnext "layer" (null lyr)))
  41.       (if
  42. (and (member (cdr (assoc 62 lyr)) (list 8 9 251 252 253 254 255))
  43.       (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  44. )
  45.   (if laylist
  46.     (setq laylist (strcat laylist "," (cdr (assoc 2 lyr))))
  47.     (setq laylist (cdr (assoc 2 lyr)))
  48.   )
  49.       )
  50.     )
  51.     laylist
  52.   )
  53.   ;;5
  54.   (defun backblk (Mins  / A      BAC    BC     BLIST  CLIPENT
  55.     ENT  ENT2 ENT3   N      NAMEB  PT     SSETB
  56.     SUBENT VIEWSSET
  57.    )
  58.     (setq blist (list '(-4 . "<NOT")
  59.         '(-4 . "<OR")
  60.         '(0 . "SOLID")
  61.         '(2 . "SOLID")
  62.         '(0 . "VIEWPORT")
  63.         '(-4 . "OR>")
  64.         '(-4 . "NOT>")
  65.         '(-4 . "<OR")
  66.         (cons 8 (getlayers))
  67.         '(62 . 8)
  68.         '(62 . 9)
  69.         '(62 . 251)
  70.         '(62 . 252)
  71.         '(62 . 253)
  72.         '(62 . 254)
  73.         '(62 . 255)
  74.         '(-4 . "OR>")
  75.   )
  76.     )
  77.     (setq ssetb (ssget "X" blist))
  78.     (if (setq viewsset (ssget "X" '((0 . "VIEWPORT"))))
  79.       (repeat (setq n (sslength viewsset))
  80. (if (setq clipent
  81.      (assoc 340 (entget (ssname viewsset (setq n (1- n)))))
  82.      )
  83.    (ssdel (cdr clipent) ssetb)
  84. )
  85.       )
  86.     )
  87.     (if ssetb
  88.       (progn
  89. (setq pt (list 0.0 0.0))
  90. (entmake ;;write block header
  91.    (list '(0 . "BLOCK")
  92.          '(2 . "*anon")
  93.          '(70 . 1)
  94.          (cons '10 pt)
  95.    )
  96. )
  97. ;;add entities in selection set to block
  98. ;;repeat for every entity in the selection set
  99. (setq a 0)
  100. (repeat (sslength ssetb)
  101.    (setq ent2 (entmake (entget (setq ent (ssname ssetb a)))))
  102.    (if (null ent2)
  103.      (princ (entget (setq ent (ssname ssetb a))))
  104.    )
  105.    ;;if polyline or block reference with attributes,
  106.    ;;walk down sub-entities until seqend is found
  107.    (if (assoc 66 (entget ent))
  108.      (progn
  109.        ;;add sub-entities until seqend is found
  110.        (setq subent (entnext ent))
  111.        (while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
  112.   (entmake (entget subent))
  113.   (setq subent (entnext subent))
  114.        )
  115.        ;;add seqend sub-entity
  116.        (setq ent3 (entmake (entget subent)))
  117.        (if (null ent3)
  118.   (princ (entget subent))
  119.        )
  120.      )
  121.    )
  122.    ;;delete original entity
  123.    (entdel ent)
  124.    (setq a (1+ a))
  125.    (spin "Making Block of background colours..")
  126. )
  127. (setq nameb (entmake '((0 . "endblk"))))
  128. ;;write block end sub-entity
  129. (princ "\n  Inserting...\n")
  130. ;; Insert block reference at insertion point
  131. ;; Note: Check the argument Mins for the method to insert the block
  132. ;; Note: Mins=T means minsert the block, and Mins=nil means insert it.
  133. (if Mins
  134.    ;;Minsert block reference at insertion point
  135.    (entmake
  136.      (list '(0 . "INSERT")
  137.     (CONS '100 "AcDbMInsertBlock")
  138.     (CONS '70 2)
  139.     (CONS '71 2)
  140.     (cons '2 nameb)
  141.     (cons '10 pt)
  142.      )
  143.    )
  144.    (entmake
  145.      (list '(0 . "INSERT")
  146.     (cons '2 nameb)
  147.     (cons '10 pt)
  148.      )
  149.    )
  150.    ;;Insert block reference at insertion point
  151. )
  152. (setq bc (entlast))
  153. (setq bac "back")
  154. (command "_.draworder" bc "" (strcat "_" bac))
  155.       )
  156.     )
  157.     (princ)
  158.   )
  159.   ;;6
  160.   (defun solidblk
  161.   (Mins / A BA ENT ENT2 ENT3 NAMES PT SLIST SO SSETS SUBENT)
  162.     (setq slist (list '(-4 . "<OR")
  163.         '(0 . "SOLID")
  164.         '(2 . "SOLID")
  165.         '(-4 . "OR>")
  166.   )
  167.     )
  168.     (if (setq ssets (ssget "X" slist))
  169.       (progn
  170. (setq pt (list 0.0 0.0))
  171. (entmake ;;write block header
  172.    (list '(0 . "BLOCK")
  173.          '(2 . "*anon")
  174.          '(70 . 1)
  175.          (cons '10 pt)
  176.    )
  177. )
  178. ;;add entities in selection set to block
  179. ;;repeat for every entity in the selection set
  180. (setq a 0)
  181. (repeat (sslength ssets)
  182.    (setq ent2 (entmake (entget (setq ent (ssname ssets a)))))
  183.    (if (null ent2)
  184.      (princ (entget (setq ent (ssname ssets a))))
  185.    )
  186.    ;;if polyline or block reference with attributes,
  187.    ;;walk down sub-entities until seqend is found
  188.    (if (assoc 66 (entget ent))
  189.      (progn
  190.        ;;add sub-entities until seqend is found
  191.        (setq subent (entnext ent))
  192.        (while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
  193.   (entmake (entget subent))
  194.   (setq subent (entnext subent))
  195.        )
  196.        ;;add seqend sub-entity
  197.        (setq ent3 (entmake (entget subent)))
  198.        (if (null ent3)
  199.   (princ (entget subent))
  200.        )
  201.      )
  202.    )
  203.    ;;delete original entity
  204.    (entdel ent)
  205.    (setq a (1+ a))
  206.    (spin "Making Block of solids..")
  207. )
  208. (setq names (entmake '((0 . "endblk"))))
  209. ;;write block end sub-entity
  210. (princ "\n  Inserting...\n")
  211. ;; Insert block reference at insertion point
  212. ;; Note: Check the argument Mins for the method to insert the block
  213. ;; Note: Mins=T means minsert the block, and Mins=nil means insert it.
  214. (if Mins
  215.    ;;Minsert block reference at insertion point
  216.    (entmake
  217.      (list '(0 . "INSERT")
  218.     (CONS '100 "AcDbMInsertBlock")
  219.     (CONS '70 2)
  220.     (CONS '71 2)
  221.     (cons '2 names)
  222.     (cons '10 pt)
  223.      )
  224.    )
  225.    (entmake
  226.      (list '(0 . "INSERT")
  227.     (cons '2 names)
  228.     (cons '10 pt)
  229.      )
  230.    )
  231.    ;;Insert block reference at insertion point
  232. )
  233. (setq so (entlast))
  234. (setq ba "back")
  235. (command "_.draworder" so "" (strcat "_" ba))
  236. (setq ssets nil)
  237.       )
  238.     )
  239.     (princ)
  240.   )
  241.   ;;7
  242.   (defun anonBlock (Mins    /     A     ALIST   CLIPENT ENT
  243.       ENT2    ENT3    N     NAME    SSET    SUBENT
  244.       VIEWSSET
  245.      )
  246.     (setq alist (list '(-4 . "<NOT")
  247.         '(-4 . "<OR")
  248.         '(0 . "VIEWPORT")
  249.         '(0 . "ACAD_PROXY_ENTITY")
  250.         '(0 . "AECC_*")
  251.         '(0 . "AEC_*")
  252.         '(0 . "AECS_*")
  253.         '(0 . "RTEXT")
  254.         '(0 . "WIPEOUT")
  255.         '(0 . "SOLID")
  256.         '(2 . "SOLID")
  257.         (cons 8 (getlayers))
  258.         '(62 . 8)
  259.         '(62 . 9)
  260.         '(62 . 251)
  261.         '(62 . 252)
  262.         '(62 . 253)
  263.         '(62 . 254)
  264.         '(62 . 255)
  265.         '(-4 . "OR>")
  266.         '(-4 . "NOT>")
  267.   )
  268.     )
  269.     (if (setq viewsset (ssget "X" '((0 . "VIEWPORT"))))
  270.       (repeat (setq n (sslength viewsset))
  271. (if (setq clipent
  272.      (assoc 340 (entget (ssname viewsset (setq n (1- n)))))
  273.      )
  274.    (ssdel (cdr clipent) sset)
  275. )
  276.       )
  277.     )
  278.     (if (setq sset (ssget "X" alist))
  279.       (progn
  280. (entmake ;;write block header
  281.    (list '(0 . "BLOCK")
  282.          '(2 . "*anon")
  283.          '(70 . 1)
  284.          (cons '10 (list 0.0 0.0))
  285.    )
  286. )
  287. ;;add entities in selection set to block
  288. ;;repeat for every entity in the selection set
  289. (setq a 0)
  290. (repeat (sslength sset)
  291.    (setq ent2 (entmake (entget (setq ent (ssname sset a)))))
  292.    (if (null ent2)
  293.      (princ (entget (setq ent (ssname sset a))))
  294.    )
  295.    ;;if polyline or block reference with attributes,
  296.    ;;walk down sub-entities until seqend is found
  297.    (if (assoc 66 (entget ent))
  298.      (progn
  299.        ;;add sub-entities until seqend is found
  300.        (setq subent (entnext ent))
  301.        (while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
  302.   (entmake (entget subent))
  303.   (setq subent (entnext subent))
  304.        )
  305.        ;;add seqend sub-entity
  306.        (setq ent3 (entmake (entget subent)))
  307.        (if (null ent3)
  308.   (princ (entget subent))
  309.        )
  310.      )
  311.    )
  312.    ;;delete original entity
  313.    (entdel ent)
  314.    (setq a (1+ a))
  315.    (spin "Making Block..")
  316. )
  317. (setq name (entmake '((0 . "endblk"))))
  318. ;;write block end sub-entity
  319. (princ "\n  Inserting Block..\n")
  320. ;; Insert block reference at insertion point
  321. ;; Note: Check the argument Mins for the method to insert the block
  322. ;; Note: Mins=T means minsert the block, and Mins=nil means insert it.
  323. (if Mins
  324.    ;;Minsert block reference at insertion point
  325.    (entmake
  326.      (list '(0 . "INSERT")
  327.     (CONS '100 "AcDbMInsertBlock")
  328.     (CONS '70 2)
  329.     (CONS '71 2)
  330.     (cons '2 name)
  331.     (cons '10 (list 0.0 0.0))
  332.      )
  333.    )
  334.    (entmake
  335.      (list '(0 . "INSERT")
  336.     (cons '2 name)
  337.     (cons '10 (list 0.0 0.0))
  338.      )
  339.    )
  340.    ;;Insert block reference at insertion point
  341. )
  342.       )
  343.     )
  344.     (princ)
  345.   )
  346.   ;;8
  347.   (defun spin (wh)
  348.     (prompt (strcat "\r  "
  349.       wh
  350.       (cond ((= #spin "|") (setq #spin "/"))
  351.      ((= #spin "/") (setq #spin "-"))
  352.      ((= #spin "-") (setq #spin "\\"))
  353.      (T (setq #spin "|"))
  354.       )
  355.      )
  356.     )
  357.     (princ)
  358.   )
  359.   ;;9 本程序主程序
  360.   (setq cmd    (getvar "cmdecho")
  361. fdia   (getvar "filedia")
  362. cdia   (getvar "cmddia")
  363. proxys (getvar "proxyshow")
  364.   )
  365.   (command "UNDO" "Begin")
  366.   (setvar "cmdecho" 0)
  367.   (setvar "filedia" 0)
  368.   (setvar "cmddia" 0)
  369.   (command "undo" "mark")
  370.   (command "-layer" "make" "LOCKUP" "")
  371.   (command "color" "bylayer")
  372.   (setvar "proxyshow" 0)
  373.   (command "regen")
  374.   (proxy)
  375.   (anonBlock nil)   ; make anon insert in named layout
  376.   (backblk nil)    ; make anon insert in named layout
  377.   (solidblk nil)   ; make anon insert in named layout
  378.   (anonBlock T)    ; make anon minsert in named layout
  379.   (command "zoom" "extents")
  380.   (command "UNDO" "End")
  381.   (setvar "cmdecho" cmd)
  382.   (setvar "filedia" fdia)
  383.   (setvar "cmddia" cdia)
  384.   (setvar "proxyshow" proxys)
  385.   (princ "\n 图纸已经锁定,使其不能修改。")
  386.   (princ)
  387. )

;;原程序
  1. ;;;Lockup.lsp - Locks all selected entities (except proxy objects) within a drawing.
  2. ;;;By: John D. Chapman
  3. ;;;With help from: Stig Madsen, Celie Dailey, Pat Starkey.
  4. ;;;Based on and expanded from AB.lsp by Brian Debelius (Make/Insert an Anonymous Block)
  5. ;;;and AB-Minsert.lsp by Rick McElvain (Make/MINSERT an Anonymous Block).
  6. ;;;Inspiration from Adam Conrath (MINSERT).
  7. ;;;Special mention to Jim Fisher.
  8. ;;;Last Revisions:
  9. ;;;March 5, 2002:  - Separate block made of solids before main routine runs.
  10. ;;;March 7, 2002:  - Separate Block made of background colours (8,9,251-255).
  11. ;;;March 22, 2002: - Improved error trapping.
  12. ;;;This routine turns on, thaws, and unlocks all layers before it starts the lock.
  13. ;;;The state of your layers prior to running LOCKUP will be restored
  14. ;;;in AutoCAD 2000i only.
  15. ;;;_______________________________________________________________________________________
  16. (alert
  17.   "\nDO NOT RUN LOCKUP ON AN ORIGINAL DRAWING.
  18.         \n         RUN ONLY ON A COPY OF THE ORIGINAL."
  19. )
  20. (alert
  21.   "\nLockup2.lsp - By John D. Chapman - Ainley and Associates Ltd.
  22.         \n  with thanks to Brian Debelius, Adam Conrath, Rick McElvain,
  23.         \n          Stig Madsen, Celie Dailey, Pat Starkey, Jim Fisher
  24.         \n               and the Autodesk User Group International."
  25. )
  26. (defun lockerror (msg)
  27.   (if (/= msg "Function cancelled")
  28.     (princ
  29.       (strcat "\nError: " msg " [" (itoa (getvar "ERRNO")) "]")
  30.     )
  31.     (princ)
  32.   )
  33.   (command "UNDO" "End")
  34.   (Abort "\nLockup was interrupted. Function Aborted!")
  35.   (setq *error* olderr)
  36.   (princ)
  37. )
  38. (defun Abort (msg)
  39.   (setvar "filedia" fdia)
  40.   (setvar "cmddia" cdia)
  41.   (setvar "cmdecho" cmd)
  42.   (alert msg)
  43. )
  44. ;;Exit
  45. (defun getlayers ()
  46.   (setq lyr (tblnext "layer" t))
  47.   (setq laylist "")
  48.   (while lyr
  49.     (if (or (and (= (cdr (assoc 62 lyr)) 8)
  50.    (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  51.      )
  52.      (and (= (cdr (assoc 62 lyr)) 9)
  53.    (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  54.      )
  55.      (and (= (cdr (assoc 62 lyr)) 251)
  56.    (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  57.      )
  58.      (and (= (cdr (assoc 62 lyr)) 252)
  59.    (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  60.      )
  61.      (and (= (cdr (assoc 62 lyr)) 253)
  62.    (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  63.      )
  64.      (and (= (cdr (assoc 62 lyr)) 254)
  65.    (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  66.      )
  67.      (and (= (cdr (assoc 62 lyr)) 255)
  68.    (not (wcmatch (cdr (assoc 2 lyr)) "*|*"))
  69.      )
  70. )
  71.       (if (equal laylist "")
  72. (setq laylist (strcat laylist (cdr (assoc 2 lyr))))
  73. (setq laylist (strcat laylist "," (cdr (assoc 2 lyr))))
  74.       )
  75.     )
  76.     (setq lyr (tblnext "layer"))
  77.   )
  78.   laylist
  79. )
  80. (defun backblk (layoutName Mins)
  81.   (if layoutName
  82.     (cond
  83.       ((= layoutName "14MS")
  84.        (setq blist (list '(-4 . "<NOT")
  85.     '(-4 . "<OR")
  86.     '(67 . 1)
  87.     '(0 . "SOLID")
  88.     '(2 . "SOLID")
  89.     '(-4 . "OR>")
  90.     '(-4 . "NOT>")
  91.     '(-4 . "<OR")
  92.     (cons 8 (getlayers))
  93.     '(62 . 8)
  94.     '(62 . 9)
  95.     '(62 . 251)
  96.     '(62 . 252)
  97.     '(62 . 253)
  98.     '(62 . 254)
  99.     '(62 . 255)
  100.     '(-4 . "OR>")
  101.      )
  102.        )
  103.       )
  104.       ((= layoutName "14PS")
  105.        (setq blist (list '(67 . 1)
  106.     '(-4 . "<NOT")
  107.     '(-4 . "<OR")
  108.     '(0 . "SOLID")
  109.     '(2 . "SOLID")
  110.     '(0 . "VIEWPORT")
  111.     '(-4 . "OR>")
  112.     '(-4 . "NOT>")
  113.     '(-4 . "<OR")
  114.     (cons 8 (getlayers))
  115.     '(62 . 8)
  116.     '(62 . 9)
  117.     '(62 . 251)
  118.     '(62 . 252)
  119.     '(62 . 253)
  120.     '(62 . 254)
  121.     '(62 . 255)
  122.     '(-4 . "OR>")
  123.      )
  124.        )
  125.       )
  126.       (T
  127.        (setq blist (list (cons 410 layoutName)
  128.     '(-4 . "<NOT")
  129.     '(-4 . "<OR")
  130.     '(0 . "SOLID")
  131.     '(2 . "SOLID")
  132.     '(0 . "VIEWPORT")
  133.     '(-4 . "OR>")
  134.     '(-4 . "NOT>")
  135.     '(-4 . "<OR")
  136.     (cons 8 (getlayers))
  137.     '(62 . 8)
  138.     '(62 . 9)
  139.     '(62 . 251)
  140.     '(62 . 252)
  141.     '(62 . 253)
  142.     '(62 . 254)
  143.     '(62 . 255)
  144.     '(-4 . "OR>")
  145.      )
  146.        )
  147.       )
  148.     )
  149.     (setq blist (list '(-4 . "<NOT")
  150.         '(-4 . "<OR")
  151.         '(0 . "SOLID")
  152.         '(2 . "SOLID")
  153.         '(0 . "VIEWPORT")
  154.         '(-4 . "OR>")
  155.         '(-4 . "NOT>")
  156.         '(-4 . "<OR")
  157.         (cons 8 (getlayers))
  158.         '(62 . 8)
  159.         '(62 . 9)
  160.         '(62 . 251)
  161.         '(62 . 252)
  162.         '(62 . 253)
  163.         '(62 . 254)
  164.         '(62 . 255)
  165.         '(-4 . "OR>")
  166.   )
  167.     )
  168.   )
  169.   (setq ssetb (ssget "X" blist))
  170.   (setq viewsset (ssget "X" '((0 . "VIEWPORT"))))
  171.   (if viewsset
  172.     (progn
  173.       (setq n 0)
  174.       (repeat (sslength viewsset)
  175. (if (setq clipent (assoc 340 (entget (ssname viewsset n))))
  176.    (ssdel (cdr clipent) ssetb)
  177. )
  178. (setq n (1+ n))
  179.       )
  180.     )
  181.   )
  182.   (if ssetb
  183.     (progn
  184.       (setq pt (list 0.0 0.0))
  185.       (entmake ;;write block header
  186.         (list '(0 . "BLOCK")
  187.        '(2 . "*anon")
  188.        '(70 . 1)
  189.        (cons '10 pt)
  190.         )
  191.       )
  192.       ;;add entities in selection set to block
  193.       ;;repeat for every entity in the selection set
  194.       (setq a 0)
  195.       (repeat (sslength ssetb)
  196. (setq ent2 (entmake (entget (setq ent (ssname ssetb a)))))
  197. (if (null ent2)
  198.    (princ (entget (setq ent (ssname ssetb a))))
  199. )
  200. ;;if polyline or block reference with attributes,
  201. ;;walk down sub-entities until seqend is found
  202. (if (assoc 66 (entget ent))
  203.    (progn
  204.      ;;add sub-entities until seqend is found
  205.      (setq subent (entnext ent))
  206.      (while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
  207.        (entmake (entget subent))
  208.        (setq subent (entnext subent))
  209.      )
  210.      ;;add seqend sub-entity
  211.      (setq ent3 (entmake (entget subent)))
  212.      (if (null ent3)
  213.        (princ (entget subent))
  214.      )
  215.    )
  216. )
  217. ;;delete original entity
  218. (entdel ent)
  219. (setq a (1+ a))
  220. (c:spin "Making Block of background colours..")
  221.       )
  222.       (setq nameb (entmake '((0 . "endblk"))))
  223.       ;;write block end sub-entity
  224.       (princ "\n  Inserting...\n")
  225.       ;; Insert block reference at insertion point
  226.       ;; Note: Check the argument Mins for the method to insert the block
  227.       ;; Note: Mins=T means minsert the block, and Mins=nil means insert it.
  228.       (if Mins
  229. ;;Minsert block reference at insertion point
  230. (entmake
  231.    (list '(0 . "INSERT")
  232.   (CONS '100 "AcDbMInsertBlock")
  233.   (CONS '70 2)
  234.   (CONS '71 2)
  235.   (cons '2 nameb)
  236.   (cons '10 pt)
  237.    )
  238. )
  239. (entmake
  240.    (list '(0 . "INSERT")
  241.   (cons '2 nameb)
  242.   (cons '10 pt)
  243.    )
  244. )
  245. ;;Insert block reference at insertion point
  246.       )
  247.       (setq bc (entlast))
  248.       (setq bac "back")
  249.       (command "_.draworder" bc "" (strcat "_" bac))
  250.       (setq ssetb nil)
  251.       (setq viewsset nil)
  252.     )
  253.   )
  254.   (princ)
  255. )
  256. (defun solidblk (layoutName Mins)
  257.   (if layoutName
  258.     (cond
  259.       ((= layoutName "14MS")
  260.        (setq slist (list '(-4 . "<NOT")       '(67 . 1)
  261.     '(-4 . "NOT>")       '(-4 . "<OR")
  262.     '(0 . "SOLID")       '(2 . "SOLID")
  263.     '(-4 . "OR>")
  264.    )
  265.        )
  266.       )
  267.       ((= layoutName "14PS")
  268.        (setq slist (list '(67 . 1) '(-4 . "<OR") '(0 . "SOLID") '(2 . "SOLID")
  269.     '(-4 . "OR>"))
  270.        )
  271.       )
  272.       (T
  273.        (setq slist (list (cons 410 layoutName)
  274.     '(-4 . "<OR")
  275.     '(0 . "SOLID")
  276.     '(2 . "SOLID")
  277.     '(-4 . "OR>")
  278.      )
  279.        )
  280.       )
  281.     )
  282.     (setq slist (list '(-4 . "<OR")
  283.         '(0 . "SOLID")
  284.         '(2 . "SOLID")
  285.         '(-4 . "OR>")
  286.   )
  287.     )
  288.   )
  289.   (setq ssets (ssget "X" slist))
  290.   (if ssets
  291.     (progn
  292.       (setq pt (list 0.0 0.0))
  293.       (entmake ;;write block header
  294.         (list '(0 . "BLOCK")
  295.        '(2 . "*anon")
  296.        '(70 . 1)
  297.        (cons '10 pt)
  298.         )
  299.       )
  300.       ;;add entities in selection set to block
  301.       ;;repeat for every entity in the selection set
  302.       (setq a 0)
  303.       (repeat (sslength ssets)
  304. (setq ent2 (entmake (entget (setq ent (ssname ssets a)))))
  305. (if (null ent2)
  306.    (princ (entget (setq ent (ssname ssets a))))
  307. )
  308. ;;if polyline or block reference with attributes,
  309. ;;walk down sub-entities until seqend is found
  310. (if (assoc 66 (entget ent))
  311.    (progn
  312.      ;;add sub-entities until seqend is found
  313.      (setq subent (entnext ent))
  314.      (while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
  315.        (entmake (entget subent))
  316.        (setq subent (entnext subent))
  317.      )
  318.      ;;add seqend sub-entity
  319.      (setq ent3 (entmake (entget subent)))
  320.      (if (null ent3)
  321.        (princ (entget subent))
  322.      )
  323.    )
  324. )
  325. ;;delete original entity
  326. (entdel ent)
  327. (setq a (1+ a))
  328. (c:spin "Making Block of solids..")
  329.       )
  330.       (setq names (entmake '((0 . "endblk"))))
  331.       ;;write block end sub-entity
  332.       (princ "\n  Inserting...\n")
  333.       ;; Insert block reference at insertion point
  334.       ;; Note: Check the argument Mins for the method to insert the block
  335.       ;; Note: Mins=T means minsert the block, and Mins=nil means insert it.
  336.       (if Mins
  337. ;;Minsert block reference at insertion point
  338. (entmake
  339.    (list '(0 . "INSERT")
  340.   (CONS '100 "AcDbMInsertBlock")
  341.   (CONS '70 2)
  342.   (CONS '71 2)
  343.   (cons '2 names)
  344.   (cons '10 pt)
  345.    )
  346. )
  347. (entmake
  348.    (list '(0 . "INSERT")
  349.   (cons '2 names)
  350.   (cons '10 pt)
  351.    )
  352. )
  353. ;;Insert block reference at insertion point
  354.       )
  355.       (setq so (entlast))
  356.       (setq ba "back")
  357.       (command "_.draworder" so "" (strcat "_" ba))
  358.       (setq ssets nil)
  359.     )
  360.   )
  361.   (princ)
  362. )
  363. (defun anonBlock (layoutName Mins)
  364.   (if layoutName
  365.     (cond
  366.       ((= layoutName "14MS")
  367.        (setq alist (list '(-4 . "<NOT")
  368.     '(-4 . "<OR")
  369.     '(67 . 1)
  370.     '(0 . "ACAD_PROXY_ENTITY")
  371.     '(0 . "AEC_*")
  372.     '(0 . "AECS_*")
  373.     '(0 . "RTEXT")
  374.     '(0 . "WIPEOUT")
  375.     ;;'(8 . "LAYCFG")
  376.     '
  377.      (0 . "SOLID")
  378.     '(2 . "SOLID")
  379.     (cons 8 (getlayers))
  380.     '(62 . 8)
  381.     '(62 . 9)
  382.     '(62 . 251)
  383.     '(62 . 252)
  384.     '(62 . 253)
  385.     '(62 . 254)
  386.     '(62 . 255)
  387.     '(-4 . "OR>")
  388.     '(-4 . "NOT>")
  389.      )
  390.        )
  391.       )
  392.       ((= layoutName "14PS")
  393.        (setq alist (list '(67 . 1)
  394.     '(-4 . "<NOT")
  395.     '(-4 . "<OR")
  396.     '(0 . "VIEWPORT")
  397.     '(0 . "ACAD_PROXY_ENTITY")
  398.     '(0 . "AEC_*")
  399.     '(0 . "AECS_*")
  400.     '(0 . "RTEXT")
  401.     '(0 . "WIPEOUT")
  402.     ;;'(8 . "LAYCFG")
  403.     '
  404.      (0 . "SOLID")
  405.     '(2 . "SOLID")
  406.     (cons 8 (getlayers))
  407.     '(62 . 8)
  408.     '(62 . 9)
  409.     '(62 . 251)
  410.     '(62 . 252)
  411.     '(62 . 253)
  412.     '(62 . 254)
  413.     '(62 . 255)
  414.     '(-4 . "OR>")
  415.     '(-4 . "NOT>")
  416.      )
  417.        )
  418.       )
  419.       (T
  420.        (setq alist (list (cons 410 layoutName)
  421.     '(-4 . "<NOT")
  422.     '(-4 . "<OR")
  423.     ;;'(8 . "LAYCFG")
  424.     '
  425.      (0 . "VIEWPORT")
  426.     '(0 . "ACAD_PROXY_ENTITY")
  427.     '(0 . "AECC_*")
  428.     '(0 . "AEC_*")
  429.     '(0 . "AECS_*")
  430.     '(0 . "RTEXT")
  431.     '(0 . "WIPEOUT")
  432.     '(0 . "SOLID")
  433.     '(2 . "SOLID")
  434.     (cons 8 (getlayers))
  435.     '(62 . 8)
  436.     '(62 . 9)
  437.     '(62 . 251)
  438.     '(62 . 252)
  439.     '(62 . 253)
  440.     '(62 . 254)
  441.     '(62 . 255)
  442.     '(-4 . "OR>")
  443.     '(-4 . "NOT>")
  444.      )
  445.        )
  446.       )
  447.     )
  448.     (setq alist (list '(-4 . "<NOT")
  449.         '(-4 . "<OR")
  450.         ;;'(8 . "LAYCFG")
  451.         '
  452.          (0 . "VIEWPORT")
  453.         '(0 . "ACAD_PROXY_ENTITY")
  454.         '(0 . "AECC_*")
  455.         '(0 . "AEC_*")
  456.         '(0 . "AECS_*")
  457.         '(0 . "RTEXT")
  458.         '(0 . "WIPEOUT")
  459.         '(0 . "SOLID")
  460.         '(2 . "SOLID")
  461.         (cons 8 (getlayers))
  462.         '(62 . 8)
  463.         '(62 . 9)
  464.         '(62 . 251)
  465.         '(62 . 252)
  466.         '(62 . 253)
  467.         '(62 . 254)
  468.         '(62 . 255)
  469.         '(-4 . "OR>")
  470.         '(-4 . "NOT>")
  471.   )
  472.     )
  473.   )
  474.   (setq sset (ssget "X" alist))
  475.   (setq viewsset (ssget "X" '((0 . "VIEWPORT"))))
  476.   (if viewsset
  477.     (progn
  478.       (setq n 0)
  479.       (repeat (sslength viewsset)
  480. (if (setq clipent (assoc 340 (entget (ssname viewsset n))))
  481.    (ssdel (cdr clipent) sset)
  482. )
  483. (setq n (1+ n))
  484.       )
  485.     )
  486.   )
  487.   (if sset
  488.     (progn
  489.       (setq pt (list 0.0 0.0))
  490.       (entmake ;;write block header
  491.         (list '(0 . "BLOCK")
  492.        '(2 . "*anon")
  493.        '(70 . 1)
  494.        (cons '10 pt)
  495.         )
  496.       )
  497.       ;;add entities in selection set to block
  498.       ;;repeat for every entity in the selection set
  499.       (setq a 0)
  500.       (repeat (sslength sset)
  501. (setq ent2 (entmake (entget (setq ent (ssname sset a)))))
  502. (if (null ent2)
  503.    (princ (entget (setq ent (ssname sset a))))
  504. )
  505. ;;if polyline or block reference with attributes,
  506. ;;walk down sub-entities until seqend is found
  507. (if (assoc 66 (entget ent))
  508.    (progn
  509.      ;;add sub-entities until seqend is found
  510.      (setq subent (entnext ent))
  511.      (while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
  512.        (entmake (entget subent))
  513.        (setq subent (entnext subent))
  514.      )
  515.      ;;add seqend sub-entity
  516.      (setq ent3 (entmake (entget subent)))
  517.      (if (null ent3)
  518.        (princ (entget subent))
  519.      )
  520.    )
  521. )
  522. ;;delete original entity
  523. (entdel ent)
  524. (setq a (1+ a))
  525. (c:spin "Making Block..")
  526.       )
  527.       (setq name (entmake '((0 . "endblk"))))
  528.       ;;write block end sub-entity
  529.       (princ "\n  Inserting Block..\n")
  530.       ;; Insert block reference at insertion point
  531.       ;; Note: Check the argument Mins for the method to insert the block
  532.       ;; Note: Mins=T means minsert the block, and Mins=nil means insert it.
  533.       (if Mins
  534. ;;Minsert block reference at insertion point
  535. (entmake
  536.    (list '(0 . "INSERT")
  537.   (CONS '100 "AcDbMInsertBlock")
  538.   (CONS '70 2)
  539.   (CONS '71 2)
  540.   (cons '2 name)
  541.   (cons '10 pt)
  542.    )
  543. )
  544. (entmake
  545.    (list '(0 . "INSERT")
  546.   (cons '2 name)
  547.   (cons '10 pt)
  548.    )
  549. )
  550. ;;Insert block reference at insertion point
  551.       )
  552.       (setq sset nil)
  553.       (setq viewsset nil)
  554.     )
  555.     ;; Note: This statement is just a debug string and can be deleted
  556.     (if layoutName
  557.       (princ (strcat "\nNo entities to lock in " layoutName))
  558.     )
  559.   )
  560.   (princ)
  561. )
  562. (defun Finish (vers)
  563.   (setvar "clayer" cla)
  564.   (setvar "tilemode" space)
  565.   (if (= vers 2)
  566.     (command "-layer" "state" "restore" "lockup" "" "")
  567.   )
  568.   (command "-layer" "lock" "*" "")
  569.   (setvar "proxyshow" 1)
  570.   (command "regen")
  571.   (cond
  572.     ((= cont "Yes")
  573.      (alert
  574.        "\nPaper space only has been locked.
  575.                                 \nTo lock model space, run Lockup
  576.                                 \nagain and do NOT skip to paper space."
  577.      )
  578.     )
  579.     ((= answer2 "Model")
  580.      (alert "\nAll selected entities have been locked.")
  581.     )
  582.     ((= answer2 nil)
  583.      (alert "\nAll selected entities have been locked.")
  584.     )
  585.   )
  586.   (setq cont nil
  587. answer2 nil
  588.   )
  589.   (princ "\nLockup has completed. ")
  590.   (princ)
  591. )
  592. ;;; Note:
  593. ;;; Separate routine still for r14, because paper space is a whole different
  594. ;;; ballgame in later versions. It supplies the keyword "14PS" to be recognized
  595. ;;; by anonBlock in order to select all entities that have group code 67 = 1
  596. (defun goLock14PS ()
  597.   (setvar "tilemode" 0)
  598.   (proxy)
  599.   (anonBlock "14PS" nil)  ; make anon insert - on paper space
  600.   (backblk "14PS" nil)   ; make anon insert - on paper space
  601.   (solidBlk "14PS" nil)   ; make anon insert - on paper space
  602.   (anonBlock "14PS" T)   ; make anon minsert - on paper space
  603.   (command "zoom" "extents")
  604.   (prompt "\n  Paper Space has been locked.")
  605.   (Finish 0)
  606. )
  607. (defun goLockPS (vers)
  608.   (if (= vers 0)
  609.     (goLock14PS)
  610.     (progn
  611.       (princ "\nType in Layout Name to make current: ")
  612.       (command "layout" "set" pause) ;type in whatever layout to set current
  613.       (while (> (getvar "cmdactive") 0) (command pause))
  614.       (proxy)
  615.       (anonBlock (getvar "CTAB") nil) ; make anon insert in named layout
  616.       (backblk (getvar "CTAB") nil) ; make anon insert in named layout
  617.       (solidblk (getvar "CTAB") nil) ; make anon insert in named layout
  618.       (anonBlock (getvar "CTAB") T) ; make anon minsert in named layout
  619.       (command "zoom" "extents")
  620.       (initget "Yes No")
  621.       (prompt
  622. (strcat "\n  Layout " (getvar "ctab") " has been locked.")
  623.       )
  624.       (setq answer
  625.       (getkword "\nAre there more layouts to lock? Y/<N>: ")
  626.       )
  627.       (cond
  628. ((or (null answer) (= answer "No"))
  629.   (Finish vers)
  630. )
  631. ((= answer "Yes")
  632.   (goLockPS vers)
  633. )
  634. (T nil)
  635.       )
  636.     )
  637.   )
  638. )
  639. (defun goLock (vers)
  640.   (setvar "tilemode" 1)
  641.   (if (= vers 2)
  642.     (command "-layer" "state" "save" "lockup" "" "" "")
  643.   )
  644.   (command "-layer" "thaw" "*" "on" "*" "unlock" "*" "")
  645.   (command "zoom" "extents")
  646.   (proxy)
  647.   (if (/= vers 0)
  648.     (progn
  649.       (anonBlock "Model" nil)  ; make anon insert in model space
  650.       (backblk "Model" nil)  ; make anon insert in model space
  651.       (solidblk "Model" nil)  ; make anon insert in model space
  652.       (anonBlock "Model" T)  ; make anon minsert in model space
  653.     )
  654.     (progn
  655.       (anonBlock "14MS" nil)
  656.       (backblk "14MS" nil)
  657.       (solidblk "14MS" nil)
  658.       (anonBlock "14MS" T)
  659.     )
  660.   )
  661.   (prompt "\n  Model Space has been locked.")
  662.   (initget "Yes No")
  663.   (setq answer
  664.   (getkword "\nDo you want to lock Paper Space? Y/<N>: ")
  665.   )
  666.   (cond
  667.     ((or (null answer) (= answer "No")) (Finish vers))
  668.     ((= answer "Yes") (goLockPS vers))
  669.     (T nil)
  670.   )
  671. )
  672. (defun states ()
  673.   (if (= vers 2)
  674.     (command "-layer" "state" "save" "lockup" "" "" "")
  675.   )
  676.   (command "-layer" "thaw" "*" "on" "*" "unlock" "*" "")
  677.   (command "graphscr")
  678.   (command "zoom" "extents")
  679.   (goLockps vers)
  680. )
  681. (defun continue ()
  682.   (initget "Yes No")
  683.   (setq cont (getkword
  684.         "\nModel Space will not be locked! Continue? Y/<N>: "
  685.       )
  686.   )
  687.   (cond ((= cont "Yes") (states))
  688. ((= cont "No") (skip))
  689. ((= cont nil) (skip))
  690.   )
  691. )
  692. (defun skip ()
  693.   (initget "Skip Model")
  694.   (setq answer2
  695.   (getkword
  696.     "\nStart in Model Space or Skip to Paper Space? Skip/<Model>:"
  697.   )
  698.   )
  699.   (cond ((= answer2 "Skip") (continue))
  700. ((= answer2 "Model") (goLock vers))
  701. ((= answer2 nil) (goLock vers))
  702.   )
  703. )
  704. (defun 14or2k (/ answer)
  705.   (initget "14 2000 2000i")
  706.   (setq answer
  707.   (getkword
  708.     "\nWhat version of AutoCAD are you in? 14/2000<2000i>: "
  709.   )
  710.   )
  711.   (cond
  712.     ((= answer "14") (setq vers 0))
  713.     ((= answer "2000") (setq vers 1))
  714.     ((= answer "2000i") (setq vers 2))
  715.     ((= answer nil) (setq vers 2))
  716.   )
  717.   (skip)
  718. )
  719. (defun goexp ()
  720.   (progn
  721.     (repeat (sslength sset)
  722.       (command "_explode" (ssname sset CNT))
  723.       (setq CNT (1+ CNT))
  724.       (c:spin "Exploding..")
  725.     )
  726.     (alert (strcat "\n    " (itoa CNT) " Entities Exploded."))
  727.   )
  728.   (setq sset nil)
  729.   (princ)
  730. )
  731. (defun xpproxy (/ xpl)
  732.   (alert
  733.     "\n     Proxy Entities have been found.
  734.     If they are not exploded, they will
  735.   be omitted from the lockup process."
  736.   )
  737.   (initget "Yes No")
  738.   (setq xpl (getkword "\nExplode Proxy Entities? Y/<N>: "))
  739.   (if (or (= xpl "No") (= xpl nil))
  740.     (princ)
  741.   )
  742.   (if (= xpl "Yes")
  743.     (goexp)
  744.   )
  745.   (princ)
  746. )
  747. (defun goerase ()
  748.   (progn
  749.     (repeat (sslength wsset)
  750.       (entdel (ssname wsset WCNT))
  751.       (setq WCNT (1+ WCNT))
  752.       (c:spin "Erasing..")
  753.     )
  754.     (alert (strcat "\n    " (itoa WCNT) " Wipeouts Erased."))
  755.   )
  756.   (setq wsset nil)
  757.   (princ)
  758. )
  759. (defun goaskerase (/ del)
  760.   (alert
  761.     "\n     Wipeouts have been found."
  762.   )
  763.   (initget "Yes No")
  764.   (setq del (getkword "\nErase Wipeouts? Y/<N>: "))
  765.   (if (or (= del "No") (= del nil))
  766.     (princ)
  767.   )
  768.   (if (= del "Yes")
  769.     (goerase)
  770.   )
  771.   (princ)
  772. )
  773. (defun gowipeout (/ where wlist)
  774.   (setq where (getvar "tilemode"))
  775.   (setq cs 67)
  776.   (if (= where 0)
  777.     (setq sp 1)
  778.   )
  779.   (if (= where 1)
  780.     (setq sp 0)
  781.   )
  782.   (setq wlist (list (cons cs sp)
  783.       '(0 . "wipeout")
  784.        )
  785.   )
  786.   (setq WCNT 0)
  787.   (setq wsset (ssget "x" wlist))
  788.   (if (= wsset nil)
  789.     (princ)
  790.   )
  791.   (if (not (= wsset nil))
  792.     (goaskerase)
  793.   )
  794.   (princ)
  795. )
  796. (defun proxy (/ where plist)
  797.   (setq where (getvar "tilemode"))
  798.   (if (= where 0)
  799.     (setq plist '((-4 . "<NOT")
  800.     (67 . 0)
  801.     (-4 . "NOT>")
  802.     (-4 . "<OR")
  803.     (0 . "ACAD_PROXY_ENTITY")
  804.     (0 . "AECC_*")
  805.     (0 . "AEC_*")
  806.     (0 . "AECS_*")
  807.     (0 . "RTEXT")
  808.     (-4 . "OR>")
  809.    )
  810.     )
  811.   )
  812.   (if (= where 1)
  813.     (setq plist '((-4 . "<NOT")
  814.     (67 . 1)
  815.     (-4 . "NOT>")
  816.     (-4 . "<OR")
  817.     (0 . "ACAD_PROXY_ENTITY")
  818.     (0 . "AECC_*")
  819.     (0 . "AEC_*")
  820.     (0 . "AECS_*")
  821.     (0 . "RTEXT")
  822.     (-4 . "OR>")
  823.    )
  824.     )
  825.   )
  826.   (setq CNT 0)
  827.   (setq sset (ssget "x" plist))
  828.   (if (= sset nil)
  829.     (princ)
  830.   )
  831.   (if (not (= sset nil))
  832.     (xpproxy)
  833.   )
  834.   (gowipeout)
  835.   (princ)
  836. )
  837. (defun c:undolock ()
  838.   ;;Undo and Reset variables
  839.   (setvar "cmdecho" 0)
  840.   (princ "\nPlease wait while Lockup is undone.")
  841.   (command "undo" "end")
  842.   (command "undo" "back")
  843.   (setvar "cmdecho" 1)
  844.   (setvar "filedia" 1)
  845.   (setvar "cmddia" 1)
  846.   (setvar "clayer" cla)
  847.   (princ "\nLockup has been undone.")
  848.   (princ)
  849. )
  850. (defun c:look (/ alist CNT sset)
  851.   (setq alist '((-4 . "<OR")
  852.   (0 . "ACAD_PROXY_ENTITY")
  853.   (0 . "AECC_*")
  854.   (0 . "AEC_*")
  855.   (0 . "AECS_*")
  856.   (0 . "RTEXT")
  857.   (0 . "WIPEOUT")
  858.   (-4 . "OR>")
  859.         )
  860.   )
  861.   (setq CNT 0)
  862.   (if alist
  863.     (progn
  864.       (setq sset (ssget "X" alist))
  865.       (if sset
  866. (repeat (sslength sset)
  867.    (setq CNT (1+ CNT))
  868. )
  869.       )
  870.       (if (= CNT 1)
  871. (alert (strcat "\n        " (itoa CNT) " Entity found."))
  872.       )
  873.       (if (> CNT 1)
  874. (alert (strcat "\n       " (itoa CNT) " Entities found."))
  875.       )
  876.     )
  877.   )
  878.   (if (= sset nil)
  879.     (alert "\nNo Entities were found.")
  880.   )
  881.   (princ)
  882. )
  883. (defun c:spin (wh)
  884.   (prompt (strcat "\r  "
  885.     wh
  886.     (cond ((= sp "|") (setq sp "/"))
  887.    ((= sp "/") (setq sp "-"))
  888.    ((= sp "-") (setq sp "\\"))
  889.    (T (setq sp "|"))
  890.     )
  891.    )
  892.   )
  893.   (princ)
  894. )
  895. (defun C:Lockup (/ start answer)
  896.   (setq fdia (getvar "filedia")
  897. cdia (getvar "cmddia")
  898. cmd (getvar "cmdecho")
  899. cla (getvar "clayer")
  900. space (getvar "tilemode")
  901. olderr *error*
  902. *error* lockerror
  903. cont nil
  904. answer2 nil
  905.   )
  906.   (setvar "cmdecho" 0)
  907.   (command "UNDO" "Begin")
  908.   (setvar "filedia" 0)
  909.   (setvar "cmddia" 0)
  910.   (command "undo" "mark")
  911.   (command "-layer" "make" "LOCKUP" "")
  912.   (command "color" "bylayer")
  913.   (setvar "proxyshow" 0)
  914.   (command "regen")
  915.   (initget "Yes No")
  916.   (setq answer
  917.   (getkword
  918.     "\nThis routine will lock the drawing! Do you really want to proceed? Y/<N>: "
  919.   )
  920.   )
  921.   (cond
  922.     ((or (= answer "No") (null answer))
  923.      (Alert "LOCKUP aborted!")
  924.     )
  925.     ((= answer "Yes") (14or2k))
  926.   )
  927.   (command "UNDO" "End")
  928.   (setq *error* olderr)
  929.   (setvar "filedia" fdia)
  930.   (setvar "cmddia" cdia)
  931.   (setvar "cmdecho" cmd)
  932.   (princ)
  933. )
  934. (princ "\nLOCKUP is loaded.")
  935. (princ "\nType LOCKUP to start.")
  936. (princ)



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2019-12-13 10:31:53 | 显示全部楼层
也锁住自己了,不过可以备份,对于有些不守信的人还是有用的。
发表于 2019-7-20 11:32:18 | 显示全部楼层
ssget 列表值错误 位置-> 行:274 列:21
发表于 2019-9-15 20:01:07 | 显示全部楼层
不错的程序,很有用收了
发表于 2012-12-4 09:08:58 | 显示全部楼层
弱弱的问一句楼主:如何解除锁定呢?
 楼主| 发表于 2012-12-4 09:22:55 | 显示全部楼层
haoryh 发表于 2012-12-4 09:08
弱弱的问一句楼主:如何解除锁定呢?

说实话,我也不知道
原程序的解锁也只是用undo来解决的

发表于 2012-12-4 09:38:08 | 显示全部楼层
自贡黄明儒 发表于 2012-12-4 09:22
说实话,我也不知道
原程序的解锁也只是用undo来解决的

那黄兄写一个得了,光有锁没得钥匙,那不成出了门就回不了家了

点评

7楼,G版有回复  发表于 2012-12-4 12:15
发表于 2012-12-4 09:39:13 | 显示全部楼层

RE: 锁定图纸,希望不能再编辑

直接保存为Pdf,当他需要编辑让他自己再转为dwg,这样又保密又方便他人。
发表于 2012-12-4 10:17:51 | 显示全部楼层
没钥匙不敢锁啊
发表于 2012-12-4 11:05:33 | 显示全部楼层
这个就是利用多重块进行加密!
这个帖子4楼程序可以解密!
http://bbs.mjtd.com/thread-92160-1-1.html

点评

确实不错!!!  发表于 2012-12-5 11:43
发表于 2012-12-4 11:36:51 | 显示全部楼层
1、多重块加密好像可以破解的。
2、 用天正的图纸加密好像能破解的少。最后只能转成JPG再转成DWG。这样转回来图纸都成一段段线组成的了
 楼主| 发表于 2012-12-5 11:42:31 | 显示全部楼层
Gu_xl 发表于 2012-12-4 11:05
这个就是利用多重块进行加密!
这个帖子4楼程序可以解密!
http://bbs.mjtd.com/thread-92160-1-1.html

你的这个程序确实可以解密,但对于属性块。。。

点评

这个是彻底打散多重块!但解密的原理是类似的,只要稍加修改即可!  发表于 2012-12-5 12:24
发表于 2012-12-5 12:30:31 | 显示全部楼层
这是一个过了河拆了桥的主意,实不可取
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-12-23 22:19 , Processed in 0.267408 second(s), 38 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表