Multiple circles
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Multiple circles
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization

Author Message
CAD_USER_SHANE



Joined: 03 Jun 2009
Posts: 1

Posted: Wed Jun 03, 2009 7:54 pm    Post subject: Multiple circles Reply with quote

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
View user's profile Send private message
CarlB



Joined: 27 Sep 2005
Posts: 121

Posted: Wed Jun 03, 2009 11:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fatty



Joined: 08 Jun 2006
Posts: 17
Location: Sankt-Petersburg, Russia

Posted: Fri Jul 03, 2009 4:21 pm    Post subject: Re: Multiple circles Reply with quote

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
View user's profile Send private message
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Access Forum - Microsoft Office Forum - Electronics

Contact Us Powered by phpBB