| Author |
Message |
CAD_USER_SHANE
Joined: 03 Jun 2009
Posts: 1
|
Posted:
Wed Jun 03, 2009 7:54 pm Post subject:
Multiple circles |
|
|
I'm looking for a lisp routine that locates diffrent size circles that shar the same ceterpoint. I need this for drawing clean up. Can anyone help me with this?
|
|
| Back to top |
|
 |
CarlB
Joined: 27 Sep 2005
Posts: 121
|
Posted:
Wed Jun 03, 2009 11:24 pm Post subject:
|
|
|
| Maybe, I think so, I'll try to whip something together within a few days if you can wait. I'm thinking the routine will select all circles, compare center points, delete circles until no 2 have the same center point. But what if say they have greatly different radii, which one wouuld you want to delete? |
|
| Back to top |
|
 |
Fatty
Joined: 08 Jun 2006
Posts: 17
Location: Sankt-Petersburg, Russia
|
Posted:
Fri Jul 03, 2009 4:21 pm Post subject:
Re: Multiple circles |
|
|
| CAD_USER_SHANE wrote: | | I'm looking for a lisp routine that locates diffrent size circles that shar the same ceterpoint. I need this for drawing clean up. Can anyone help me with this? |
Here is my very old one, don't remember how it will works
| Code: | (defun C:DELCIRCLE ( / a b i ss cnt)
(prompt "Delete duplicate circles")
(setq ss (ssget "_X" '((0 . "CIRCLE"))))
(if ss
(progn
(setq i -1 cnt 0)
(repeat (1- (sslength ss))
(setq i (1+ i) a (ssname ss i) b (ssname ss (1+ i)))
(if (and
(equal (cdr (assoc 10 (entget a)))
(cdr (assoc 10 (entget b))))
(equal (cdr (assoc 40 (entget a)))
(cdr (assoc 40 (entget b)))))
(progn
(setq cnt (1+ cnt))
(command "_.erase" a "")
)
)
)
(if (= cnt 0)
(princ "There are no duplicate circles in this drawing")
(alert (strcat "Deleted " (itoa cnt) " circles"))
)
)
)
(princ)
) |
~'J'~ |
|
| Back to top |
|
 |
|
|
|
|