Skip to main content
Inspiring
May 24, 2011
Answered

How to select only objects within a selection marquee?

  • May 24, 2011
  • 11 replies
  • 69209 views

I am a new user of Illustrator CS5, switching from Freehand. I am trying to find out if there is a way to select only the objects within a selection marquee? In AutoCAD you can make a selection window from left to right and only those objects entirely within the window are selected. If you window from right to left all objects that are "crossed" or touched by the window are selected. Is there a similar technique in Illustrator?

Currently I have to select the objects, then go back and hold the shift key to deselect the object I don't want, or lock layers to prevent extra objects getting selected.

    This topic has been closed for replies.
    Correct answer CarlosCanto

    OK folks, back to the original question, is there a way to select only the objects contained within a selection marquee. A lot of the answers submitted offer complicated, multi-step processes to what should be a very simple need. Drag the window to the right to select only the objects within the marquee, drag the window to the left to select any objects touched by the marquee. Click, drag, release. Ta dah!

    So based on this discussion I am guessing that the answer to my original question is no. So maybe the developers will consider adding this feature to future updates.

    I am always impressed by users inventiveness in getting around roadblocks in programs and bending them to their will. And I am always flumoxed by developers who load programs with minutely detailed tools but overlook the obvious in offering simple productive tools for frequent tasks.


    No

    11 replies

    Mike_Gondek10189183
    Community Expert
    Community Expert
    May 24, 2011

    Try the lasso tool

    Works better than a marque as you are not limited to only square shapes.

    Ngaio9Author
    Inspiring
    May 24, 2011

    I'm new to Illustrator, what does the lasso tool do?

    CarlosCanto
    Community Expert
    Community Expert
    May 25, 2011

    Marie wants to be able to do this, where the dotted line is your lasso selection.

    I think the Lasso Tool would be a better place to put the feature rather than the direct select or the selection tool
    as you can define a more random selection. and what would be great is if you could access the lasso tool when using
    another tool with command l for the traditional way of selecting and option L for the way marie would also be able to select.

    I bet if she visited the scripting forum she might get those guys on it and a script might work.Problem there is keyboard short cuts for scripts do not stick
    so you might have to create an action invoking the script and assign keyboard to the action.

    It is a very good feature and should be implemented.


    Hi Wade, I scripted it the way Marie originally wanted it, by defining a "window".

    keyboard short cuts for scripts do not stick

    I have made a coupe of tutorials on how to run scripts via 2-clicks and shortcut key stroke for Windose. They don't involve programming, so I wonder if there are similar features on the Mac that could do something similar. Hover the mouse over my username to check those out.

    #target Illustrator

    //  script.name = selectWithinRect.jsx;

    //  script.description = selects all items fully enclosed by a top most Rectangle;

    //  script.required = draw the "selection Marquee" Rectangle first before running;

    //  script.parent = carlos canto // 5/25/11;

    //  script.elegant = false;

    var idoc = app.activeDocument;

    var topPath = idoc.pathItems[0];

    var tpVB = topPath.visibleBounds;

    var left = tpVB[0];

    var top = tpVB[1];

    var right = tpVB[2];

    var bottom = tpVB[3];

    for (i = 1 ; i<idoc.pageItems.length; i++)

         {

              

              var iart = idoc.pageItems;

              

              if (isPointIn(top,left,bottom,right,iart) == "true")

                   {

                        iart.selected = true;

                   }

              //alert(isPointIn(top,left,bottom,right,iart));

         }

    topPath.remove();

    function isPointIn(top,left,bottom,right,iart)

         {

              var vb = iart.visibleBounds;

              ileft = vb[0];

              itop = vb[1];

              iright = vb[2];

              ibottom = vb[3];

              

              if ( ileft>left && itop<top && iright<right && ibottom>bottom)

                   return "true";

              else

                   return "false";

         }