Help-overlap problem
I know how to use "overlap" in Autocad & I already readed a theme(Help - Select duplicate entities) but it still can't solve my problem.
Is any lisp that can select overlapping block & entities(line&pline&circle) and put all overlapping entities in other layer at the same time?
example-try to select red entities and put them in other layer at the same time.
example.dwg
i think your drawing objects not overlap in same position actually (there 2 different blocks)
maybe you can try command: qselect ?
then filter by layers, color etc.. Dear hanhphuc-- Thanks for your reply, actually I have a design and need use many different blocks inside but how can I find overlapping different blocks?
(I just put 2 different blocks in my example actually I need to put over 10 different blocks in my design and it real very different find overlapping different blocks:oops:)
example1.dwg did you try command: overkill ?
though you can try qselect filter by Name,
this is isolate method which by fitering block name, you still have to manually test due to i'm not sure which type block you want to keep or erase
command: test
;invoke program then
pick any reference block entity, it will hide the matched name blocks.
the leftover maybe the overlaps. *mark with red circle (optional).
(defun c:test1 (/ e e1 i typ ss vs) (setq vs '(nil (/ (getvar 'viewsize) (cadr (getvar 'screensize))))) ; *optional (if (and (setq e (entsel "\nSelect reference block.. ")) (setq e (car e) typ (cdr (assoc 2 (entget e))) ss (ssget ":L" (list '(0 . "INSERT")));(cons 2 name) ) ;_ end of setq ) ;_ end of and (repeat (setq i (sslength ss)) (setq e1 (ssname ss (setq i (1- i)))) (if (equal typ (cdr (assoc 2 (entget e1))) )(redraw e1 2)(redraw e1 3);comment this if entmake circle ;;; (entmake (list '(0 . "CIRCLE");*optional;;; '(8 . "highlight");;; '(62 . 1);;; (cons 40 (* (vs) 5.));;; (cons 10 (cdr (assoc 10 (entget e1))));;; ) ;_ end of list;;; ) ;_ end of entmake) ;_ end of if ) ;_ end of repeat ) ;_ end of if (princ) ) ;_ end of defun
step by step , repeat to test the leftover...
command: regen ;to restore hidden blocks
HTH Dear hanhphuc,
Thanks, overkill can't use for block.
Pls have a review the example2. There are many blocks in my DWG.
I want all blocks but there are two blocks overlapping(just like pink area)
how can I find this overlapping in this drawing quickly?
Please advise me, thanks thanks thanks:cry:
example2.dwg I hope that hanhphuc won't mind if I posted my attempt .
Be careful that this may delete the other block and not the required one and that's why I gave the user the chance to select blocks to see the changes clearly .
(defun c:Test (/ s) ;;Tharwat 28.11.2014 ;; (if (setq s (ssget "_:L" '((0 . "INSERT")))) ((lambda (x / a b ss i _sn sn) (while (setq _sn (ssname s (setq x (1+ x)))) (vla-getboundingbox (vlax-ename->vla-object _sn) 'a 'b) (if (setq ss (ssget "_C" (vlax-safearray->list a) (vlax-safearray->list b) '((0 . "INSERT")) ) ) (repeat (setq i (sslength ss)) (if (not (eq (setq sn (ssname ss (setq i (1- i)))) _sn)) (entdel _sn) ) ) ) ) ) -1 ) ) (princ))(vl-load-com)
Just a normal filter for insertion points then hide if not overlap,
ie: the rest visible blocks are considered "overlap" ,you decide yourself to erase manually.
command: ubi
;unique block insertion;hide if insertion points are unique(defun c:ubi ( / e ss lst l)(setq ss(ssget ":L" (list '(0 . "INSERT"))))(setq lst (acet-ss-to-list ss) )(while lst(setq l (cons (setq e (car lst)) l) lst (cdr lst)lst (vl-remove-if ''((x)(equal (cdr(assoc 10 (entget e ))) (cdr(assoc 10 (entget x) )) 1e-3)) lst)) )(foreach x l (redraw x 2))(princ))
use this as genaral filter,
then use Tharwat's finer tune or the previous post#4 Dear Tharwat,
Thanks a lot!!
Dear hanhphuc,
Thank you for your help!!
You're welcome .
页:
[1]
2