vlsf1980 Posted December 16, 2011 Posted December 16, 2011 Hi, I have a problem with my design that I can't solve. Hope someone here can help me out. I'm drawing a design that consist of 2 level of arrays. Each array is the same; circles arrange in hexagonal shape which I have no problem drawing. There is two arrays all together, with a bigger diameter circle (in green) array on top of this smaller circle array depicted in the picture below: Both arrays are in different layer. Now the problem is that I need to remove those smaller circle that are INSIDE and those that CROSSED the bigger circle parameters. I have successfully do the deleting of the smaller circles inside the larger one by using a lisp call wps.lisp but those circles that are crossed did not get deleted. Also, it only allowed me to choose 1 circle at a time, which is no use to me as I have an array of those larger circle to delete. Hope someone will know a way or recommend me a lisp that I can used for this problem. Many thanks! wps.lsp array.dwg Quote
ReMark Posted December 16, 2011 Posted December 16, 2011 Wouldn't you be trimming the smaller circles where they intersect with the larger circle? Quote
vlsf1980 Posted December 16, 2011 Author Posted December 16, 2011 Those smaller circle that touch the bigger circle perimeters need to be remove as well and not trim. Quote
ReMark Posted December 16, 2011 Posted December 16, 2011 OK...just checking. Then it sounds as though you need a lisp routine that deletes all objects inside the larger diameter circle as well as any that might lie on the circle itself. Gotcha. Well it seems you are 90% there and just need a tweak of the lisp routine you mentioned using. Quote
SLW210 Posted December 16, 2011 Posted December 16, 2011 I moved this to the AutoLISP, Visual LISP & DCL forum for you. Have you checked Lee Mac's site? He might have something like that. Quote
ReMark Posted December 16, 2011 Posted December 16, 2011 I can do it using a "non-lisp" method but it has one minor drawback that I have yet to work out. It involves the use of the FASTSEL command found in Express Tools. Quote
Lee Mac Posted December 16, 2011 Posted December 16, 2011 Window over your green circles with this: (defun c:test ( / a b c e i j l n r s ) (if (setq s (ssget '((0 . "CIRCLE") (8 . "Layer1")))) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i)))) c (cdr (assoc 10 e)) r (cdr (assoc 40 e)) l nil a (/ pi 25.) n (- a) ) (repeat 50 (setq l (cons (polar c (setq n (+ n a)) r) l)) ) (if (setq b (ssget "_CP" l '((0 . "CIRCLE") (8 . "Layer2")))) (repeat (setq j (sslength b)) (entdel (ssname b (setq j (1- j)))) ) ) ) ) (princ) ) Quote
vlsf1980 Posted December 16, 2011 Author Posted December 16, 2011 I can do it using a "non-lisp" method but it has one minor drawback that I have yet to work out. It involves the use of the FASTSEL command found in Express Tools. hi ReMark, thanks for helping. i'll try out the fastsel command you mentioned when i go back to work on Monday. If you have any other good method please do share. As for lisp routine, although i'm a autocad users for years, i have not learn how to write one other than using what i can find on the web. if some pros here can help me modified the wps.list (if possible) to include deleting those that are crossed by the bigger circle and can be use on multiple circle at one time in the array i would really appreciate it. think it is also time for me to learn how to appreciate and understand lisp more. Quote
ReMark Posted December 16, 2011 Posted December 16, 2011 vlsf: Look no further than the post preceding yours. Lee Mac has come to your rescue. Like a good neighbor...Lee Mac is there. Quote
vlsf1980 Posted December 16, 2011 Author Posted December 16, 2011 wow! thanks Lee Mac and ReMark! i almost jump out of my chair when the lisp works when i try it on my laptop (which have a old 2004 version:oops:) this forum is great! you guys save me a lot of head scratching... :D:D Quote
Lee Mac Posted December 16, 2011 Posted December 16, 2011 You're very welcome vlsf, it didn't take long to write Quote
ReMark Posted December 16, 2011 Posted December 16, 2011 The credit rightfully goes to Lee Mac. I just kept you talking until he saved the day. Quote
ReMark Posted December 16, 2011 Posted December 16, 2011 Alan: Doesn't "South Park" have an opening for a new writer? Quote
alanjt Posted December 16, 2011 Posted December 16, 2011 Alan: Doesn't "South Park" have an opening for a new writer? Already sent in my application. Quote
ReMark Posted December 16, 2011 Posted December 16, 2011 I'll be looking forward to that first episode. It ought to be da bomb. Quote
alanjt Posted December 16, 2011 Posted December 16, 2011 I'll be looking forward to that first episode. It ought to be da bomb. It'll be killer. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.