Need selection tool - all objects inside a selected object

Discussion in 'AutoCAD' started by John Cutler, Jan 6, 2005.

  1. John Cutler

    John Cutler Guest

    Hi, all --

    I've been through Express tools and don't see what I need....

    Is there a selection tool that will select all objects that are within and
    crossed by a selected object?

    For example, select all polygons, points, circles, arcs, etc., that are
    inside and crossed by a selected polygon?

    I can live with a selection tool that selects those objects only INSIDE the
    selected object (doesn't have to also select objects touched or crossed by
    the selected object).

    Thanks.
    --
    John

    )))))))
    (o)-(o)
    -----oo0---(_)---0oo--------------------------
    | | | | | | | | | | | | | | | | | |
    | | | | | | | | | | | | | | | | | |

    John Cutler -- Mapping/GIS Director,
    Ozark Regional Land Trust
    (Ozark Bioregion - MO/AR/KS/OK)
    2435 Sweetwater Lane
    Mansfield MO 65704
    (417) 741-7363 - Work
    (870) 365-5938 - Cell

    www.orlt.org
     
    John Cutler, Jan 6, 2005
    #1
  2. John Cutler

    Jeff Mishler Guest

    Get the coordinates of the selected polygon and feed them as Fence points to
    (ssget "f" pts).
     
    Jeff Mishler, Jan 6, 2005
    #2
  3. John Cutler

    Tom Smith Guest

    Get the coordinates of the selected polygon and feed them as Fence points
    to
    Why not use the CP method and pick the vertices of the polygon for the
    points? I once had a routine to extract the points from a selected polyline
    and feed them to the WP or CP selection methods, but I don't have it handy
    now.
     
    Tom Smith, Jan 6, 2005
    #3
  4. Not just "why not use the CP method" -- you really have to use that to get
    what the original poster is after. The Fence method will only find things
    that cross the path of fence points, but will not find things enclosed
    within it if they don't touch it.
     
    Kent Cooper, AIA, Jan 6, 2005
    #4
  5. I'm realizing that if the "selected polygon" includes arc segments, feeding
    its coordinates to either F or CP selection could "fail" in John's goal,
    possibly in both directions (missing some things it should select, and
    selecting some things it shouldn't).

    Because F and CP don't believe in curves, the selection would look along the
    straight line between the ends of an arc segment of the polyline (the
    chord). If there is an outward-bulging arc segment, the selection would
    miss an object that's crossed by that arc segment, if it's far enough out
    not to be crossed by the chord. Likewise, if the polyline includes an
    inward-bulging arc segment, the selection would find objects that it
    shouldn't, if they're close enough to cross the chord but the arc segment
    doesn't cross them.

    John, would you want to be able to select using a circle, or to select
    things-that-cross-only, using non-closed objects like lines or arcs or open
    polylines?
     
    Kent Cooper, AIA, Jan 7, 2005
    #5
  6. John Cutler

    Tom Smith Guest

    John, would you want to be able to select using a circle, or to select
    I wondered the same, Kent. That would be a darn handy selection tool if
    someone would create it!
     
    Tom Smith, Jan 7, 2005
    #6
  7. I think this kind of selection is done already by the Extrim command from
    the express tools,
    when you extrim a circle it draws a Pline to use it as a cutting edge, hope
    this helps

    Saludos

    Marco Jacinto
     
    Marco Jacinto, Jan 7, 2005
    #7
  8. John Cutler

    Tom Smith Guest

    I think this kind of selection is done already by the Extrim command from
    the express tools

    Thanks! It appears you are correct. That's a tool that I have neglected to
    explore.
     
    Tom Smith, Jan 7, 2005
    #8
  9. John Cutler

    John Cutler Guest

    Well, my original thought was to select all objects inside a closed
    polyline.

    I'm working with ArcView .shp file data that have been imported to AutoCAD,
    and want to select all the county objects within a state border, or all the
    road objects or city polygons within a county, etc. Not all the inside
    objects are closed objects -- e.g., sometimes the outline of a lake will
    actually consist of several unconnected polylines even though the lake
    appears as a closed polyline.

    I think the most useful routine to me would be one that selected all the
    objects (line, circle, polyline, arc, etc.) within a CLOSED object.
    Selecting all objects that are inside OR crossing would be useful in another
    situation I'm working on. Could these functions be combined in the same
    routine by asking an initial question and setting a parameter for <I>nside
    or <C>rossing?

    Regarding whether the bounding object is a polyline and/or circle --- a
    polyline is the most important; a circle might be useful in some situations.
    I'm mostly doing map work, so circles are rare.

    Thanks

    J
     
    John Cutler, Jan 8, 2005
    #9
  10. John Cutler

    Jipthiyas Guest

    Try this. You need to input (ssx1) when select prompt occurs

    (defun ssx1()
    (setq enn1 (entsel "\nSelect th Boundary Polyline.. "))
    (if enn1
    (progn
    (setq evv1 (vlax-ename->vla-object (car enn1)))
    (setq evv1_name (vlax-get-property evv1 'ObjectName))
    (if (= evv1_name "AcDb2dPolyline" )
    (progn
    (setq exp_cordinates_array (Vlax-get-property evv1 'coordinates))
    (setq poly_coord_list1 (vlax-safearray->list (vlax-variant-value exp_cordinates_array)))
    (setq req_cord_list nil)
    (while (and poly_coord_list1 (nth 2 poly_coord_list1))
    (setq req_cord_list (append req_cord_list (list (list (nth 0 poly_coord_list1)(nth 1 poly_coord_list1) (nth 2 poly_coord_list1)))))
    (setq poly_coord_list1 (cdr (cdr (cdr poly_coord_list1))))
    )
    ;to close the polyline
    (setq first_cord_list (nth 0 req_cord_list))
    (setq req_cord_list (append req_cord_list (list (list (nth 0 first_cord_list)(nth 1 first_cord_list) (nth 2 first_cord_list)))))
    )
    )
    )
    )
    (ssget "cp" req_cord_list)
    )
     
    Jipthiyas, Jan 8, 2005
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.