+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Forum Newbie
    Using
    AutoCAD 2008
    Join Date
    Mar 2011
    Posts
    6

    Default How to select all objects enclosed in a poly line

    Registered forum members do not see this ad.

    Im practicing for my CAD certification test and im trying to select all objects inclosed in a poly line. Right now i have a bunch of random circles and a random figure drawn in the middle of a bunch of circles. How do i select ONLY the circles that are completely in the object??
    P.S. I would add a picture but i dont know how to take a screenshot on windows xp.

  2. #2
    Forum Deity Jack_O'neill's Avatar
    Computer Details
    Jack_O'neill's Computer Details
    Operating System:
    xp
    Discipline
    Architectural
    Jack_O'neill's Discipline Details
    Discipline
    Architectural
    Details
    The bulk of my business is commercial curtainwall, site plans and floor plans. I do occasionally get a bit of tool and die, and the odd house now and again.
    Using
    AutoCAD 2010
    Join Date
    Sep 2008
    Location
    lost in the Arkansas wilderness
    Posts
    2,146

    Default

    Much depends on exactly what you are trying to accomplish. Are you selecting these things manually, or trying to write a lisp routine that selects only circles? If you are doing just with your mouse, then obviously you can go round and pick the ones you want. Alternately, you can drag a window or crossing around the area where the circles are, then deselect the stuff you don't want. You can put the circles on thier own layer, and freeze the layers the other objects are on. They'll disappear when you do that, leaving only the circles behind. There are probably a hundred other ways to do it too.

    To take a screen shot, hit the "prt scrn" button just to the right of the F12 key. That will capture everything on your screen (or both screens if you have dual monitors) to your windows clipboard. Then you can open Paint or your favorite photo editor, paste it in and crop out anything you don't wish to share. This will have the advantage of making the file smaller too. Then save it as a JPG with a name you can remember. Sounds more complicated than it really is. After you've done it a couple times, it will be easy.
    Never try to teach a pig to sing. It wastes your time and annoys the pig. -Robert Heinlein

  3. #3
    Forum Deity
    Computer Details
    nestly's Computer Details
    Operating System:
    Windows 7 Pro (64bit)
    Using
    AutoCAD 2015
    Join Date
    Sep 2010
    Location
    PA
    Posts
    3,444

    Default

    One method would be to use SELECT with the WPolygon option to select all the objects completely within the polygon boundary, then while those objects are still selected, start QSELECT and filter only for circles.

    Here's a demo. http://screencast.com/t/5LE7obOkK

  4. #4
    Forum Newbie
    Using
    AutoCAD 2008
    Join Date
    Mar 2011
    Posts
    6

    Default

    Quote Originally Posted by nestly View Post
    One method would be to use SELECT with the WPolygon option to select all the objects completely within the polygon boundary, then while those objects are still selected, start QSELECT and filter only for circles.

    Here's a demo. http://screencast.com/t/5LE7obOkK
    Thats exactly what I needed thanks!

    Quote Originally Posted by Jack_O'neill View Post
    Much depends on exactly what you are trying to accomplish. Are you selecting these things manually, or trying to write a lisp routine that selects only circles? If you are doing just with your mouse, then obviously you can go round and pick the ones you want. Alternately, you can drag a window or crossing around the area where the circles are, then deselect the stuff you don't want. You can put the circles on thier own layer, and freeze the layers the other objects are on. They'll disappear when you do that, leaving only the circles behind. There are probably a hundred other ways to do it too.

    To take a screen shot, hit the "prt scrn" button just to the right of the F12 key. That will capture everything on your screen (or both screens if you have dual monitors) to your windows clipboard. Then you can open Paint or your favorite photo editor, paste it in and crop out anything you don't wish to share. This will have the advantage of making the file smaller too. Then save it as a JPG with a name you can remember. Sounds more complicated than it really is. After you've done it a couple times, it will be easy.
    Now I know how to take screenshots! Thanks you Both!!

  5. #5
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,169

    Default

    Select, WP within polygon, CP crossing polygon, F fence touches object, W window left to right v's right to left

  6. #6
    Super Member
    Computer Details
    designerstuart's Computer Details
    Operating System:
    xp
    Computer:
    various
    Discipline
    Architectural
    designerstuart's Discipline Details
    Occupation
    architect
    Discipline
    Architectural
    Using
    ADT 2009
    Join Date
    Jun 2010
    Location
    near london, near europe
    Posts
    867

    Default

    but there isn't a way to click the object, say, polyline, and have all its contents selected is there?ie. you still have to draw a polygon so if the bounding object is a circle a very long process might be required. jack's answer is true - so many other ways!

  7. #7
    Forum Deity Jack_O'neill's Avatar
    Computer Details
    Jack_O'neill's Computer Details
    Operating System:
    xp
    Discipline
    Architectural
    Jack_O'neill's Discipline Details
    Discipline
    Architectural
    Details
    The bulk of my business is commercial curtainwall, site plans and floor plans. I do occasionally get a bit of tool and die, and the odd house now and again.
    Using
    AutoCAD 2010
    Join Date
    Sep 2008
    Location
    lost in the Arkansas wilderness
    Posts
    2,146

    Default

    If you get a 100 autocad users in the same room and ask how to do something, you could probably get 90 different ways!
    Never try to teach a pig to sing. It wastes your time and annoys the pig. -Robert Heinlein

  8. #8
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,199

    Default

    Seemed interesting. Works on Circles, Ellipses and close Polylines...

    Code:
    (defun c:SWC (/ _pac add ss i temp i2)
      ;; Select Within Curve
      ;; Alan J. Thompson, 03.31.11
    
      (vl-load-com)
    
      (defun _pac (e / l v d lst)
        (setq d (- (setq v (/ (setq l (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e))) 100.))))
        (while (< (setq d (+ d v)) l)
          (setq lst (cons (vlax-curve-getPointAtDist e d) lst))
        )
      )
    
      (princ "\nSelect closed curves to select object(s) within: ")
      (if (setq add (ssadd)
                ss  (ssget '((-4 . "<OR")
                             (0 . "CIRCLE,ELLIPSE")
                             (-4 . "<AND")
                             (0 . "*POLYLINE")
                             (-4 . "&=")
                             (70 . 1)
                             (-4 . "AND>")
                             (-4 . "OR>")
                            )
                    )
          )
        (progn (repeat (setq i (sslength ss))
                 (if (setq temp (ssget "_WP" (_pac (ssname ss (setq i (1- i))))))
                   (repeat (setq i2 (sslength temp)) (ssadd (ssname temp (setq i2 (1- i2))) add))
                 )
               )
               (sssetfirst nil add)
               (ssget "_I")
        )
      )
      (princ)
    )
    DropBox
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  9. #9
    Super Member
    Computer Details
    designerstuart's Computer Details
    Operating System:
    xp
    Computer:
    various
    Discipline
    Architectural
    designerstuart's Discipline Details
    Occupation
    architect
    Discipline
    Architectural
    Using
    ADT 2009
    Join Date
    Jun 2010
    Location
    near london, near europe
    Posts
    867

    Default

    great fun alan, thanks.
    knew it would only be a matter of time before you turned up.....

  10. #10
    Forum Deity
    Computer Details
    nestly's Computer Details
    Operating System:
    Windows 7 Pro (64bit)
    Using
    AutoCAD 2015
    Join Date
    Sep 2010
    Location
    PA
    Posts
    3,444

    Default

    Registered forum members do not see this ad.

    Dang Alan, I wish I could write AutoLISP like that.
    Probably half the lisps I use were written by you.

Similar Threads

  1. Use Quick Select to select objects in your AutoCAD drawing
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 16th Mar 2011, 04:29 pm
  2. line to poly
    By mart in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 5th May 2010, 01:36 pm
  3. How to select objects that touch a line?
    By M76 in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 4th Feb 2010, 11:23 am
  4. Line and enclosed box Linetype HELP!
    By ALLI in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 6
    Last Post: 15th Jan 2009, 02:40 pm
  5. Quickly select objects with Quick Select
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 23rd Dec 2007, 01:13 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts