Jump to content

Selecting object inside another object in array form


Recommended Posts

Posted

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.

 

 

 

1.jpg

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:

2.jpg

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.

3.jpg

 

 

Hope someone will know a way or recommend me a lisp that I can used for this problem. Many thanks!

wps.lsp

array.dwg

Posted

Wouldn't you be trimming the smaller circles where they intersect with the larger circle?

Posted

Those smaller circle that touch the bigger circle perimeters need to be remove as well and not trim. :)

Posted

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.

Posted

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.

Posted

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)
)

Posted
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. :cry:

Posted

vlsf: Look no further than the post preceding yours. Lee Mac has come to your rescue. Like a good neighbor...Lee Mac is there.

Posted

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:D

Posted

The credit rightfully goes to Lee Mac.:thumbsup: I just kept you talking until he saved the day.:)

Posted

Alan: Doesn't "South Park" have an opening for a new writer?:rofl:

Posted
Alan: Doesn't "South Park" have an opening for a new writer?:rofl:

Already sent in my application. :P

Posted

I'll be looking forward to that first episode. It ought to be da bomb.:bomb:

Posted
I'll be looking forward to that first episode. It ought to be da bomb.:bomb:

It'll be killer.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...