最初由 cqnj023 发布
[B]
对,再试试这张图,Audit会无效的。 [/B]
用ActiveX方法重新插入块,把Minsert删除。
http://www.artnet.com.pl/lkozicki/graty/acad.html
- <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700" id="AutoNumber1" height="498">
- <tr>
- <td width="100%" height="489">
- <iframe name="I1" width="100%" height="100%" src="http://www.artnet.com.pl/lkozicki/graty/acad.html">
- 浏览器不支持嵌入式框架或配置为不显示嵌入式框架
- </iframe>
- </td>
- </tr>
- </table>
复制代码
Minsert <-> Insert 互换程序

- ;;; ====================================================================== ;;;
- ;;; ;;;
- ;;; TogBlk.LSP ;;;
- ;;; Copyright (c) 2000 by Lukasz Kozicki ;;;
- ;;; ;;;
- ;;; ====================================================================== ;;;
- ;;; ;;;
- ;;; Permission to use, copy, modify, and distribute this software for any ;;;
- ;;; purpose and without fee is hereby granted. It is freeware, but do not ;;;
- ;;; hesitate to send me a post-card or an e-mail, if you find it useful. ;;;
- ;;; ;;;
- ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ;;;
- ;;; IT MAY NOT BE ERROR FREE, IF YOU USE IT, YOU DO THAT AT YOUR OWN RISK. ;;;
- ;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF ;;;
- ;;; MERCHANTABILITY ARE HEREBY DISCLAIMED. ;;;
- ;;; ;;;
- ;;; Lukasz Kozicki ;;;
- ;;; ul. Krasickiego 24/65 ;;;
- ;;; 81-385 Gdynia 8 Poland ;;;
- ;;; [email]lkozicki@atelier.pl[/email] ;;;
- ;;; ;;;
- ;;; Gdynia, September 2000 ;;;
- ;;; ;;;
- ;;; ====================================================================== ;;;
- ;;; ;;;
- ;;; DESRIPTION ;;;
- ;;; ;;;
- ;;; This function permits to toggle an inserted BLOCK between INSERT and ;;;
- ;;; MINSERT entities. This is the remedy for the stupid manner of treating ;;;
- ;;; Inserts and Minserts of a block as completely different entities - as ;;;
- ;;; it is introduced in AutoCAD r. 15 , due to separate DXF codes 100 : ;;;
- ;;; (100 . "AcDbBlockReference") and (100 . "AcDbMInsertBlock"). ;;;
- ;;; ;;;
- ;;; With a MINSERT, the function reads a MinsertBlock, sets the number ;;;
- ;;; of rows and number of columns do 0 and makas a new BlockReference in ;;;
- ;;; the same location. ;;;
- ;;; ;;;
- ;;; With an INSERT, it sets rows and columns to 1 and makes a new ;;;
- ;;; MinsertBlock in the lobcation of a BlockReference. ;;;
- ;;; ;;;
- ;;; The oryginal entities are deleted from the drawing. ;;;
- ;;; ;;;
- ;;; ====================================================================== ;;;
- ;;; ;;;
- ;;; USAGE ;;;
- ;;; ;;;
- ;;; Simply click the mouse on an inserted block. If it is an INSERT, it ;;;
- ;;; will be converted to a MINSERT. If its a MINSERT, it will be converted ;;;
- ;;; to an INSERT. ;;;
- ;;; ;;;
- ;;; ====================================================================== ;;;
- (defun C:TOGBLK (/ bt)
- (defun bt (/ qq qn qt)
- (setq qq
- (cdr
- (entget
- (setq qn (car (entsel "Select a Block Insert/Minsert\n")))
- )
- )
- )
- (if (member '(0 . "INSERT") qq)
- (progn
- (princ "OK\n")
- (if (setq qt (member '(100 . "AcDbMInsertBlock") qq))
- (progn
- (setq qt
- (append
- (cdr qt)
- (cdr (member '(100 . "AcDbMInsertBlock") (reverse qq))
- )
- )
- )
- (setq qt (subst '(70 . 0) (assoc '70 qt) qt))
- (setq qt (subst '(71 . 0) (assoc '71 qt) qt))
- (entmake (reverse qt))
- (entdel (cdr (assoc '-1 (entget qn))))
- )
- )
- (if (setq qt (member '(100 . "AcDbBlockReference") qq))
- (progn
- (setq qt
- (append
- (cdr qt)
- (cdr
- (member '(100 . "AcDbBlockReference") (reverse qq))
- )
- )
- )
- (setq qt (subst '(70 . 1) (assoc '70 qt) qt))
- (setq qt (subst '(71 . 1) (assoc '71 qt) qt))
- (entmake (reverse qt))
- (entdel (cdr (assoc '-1 (entget qn))))
- )
- )
- )
- (princ "Selected entity is not a Block Insert/Minsert\n")
- )
- (princ)
- )
- (command "_.redraw")
- (bt)
- )
|