Visio Guy

Visio Discussions => General Visio => Topic started by: YossiD on January 06, 2009, 06:34:58 AM

Title: Area select without dragging background
Post by: YossiD on January 06, 2009, 06:34:58 AM
I often need to select multiple shapes that are located over a background shape. Is there a way to avoid selecting and dragging the background shape when using Area Select?

Here are the solutions I've found so far. None of them is very convenient:

1. Selecting the shapes one by one. This is a real pain when there are lots of small shapes as when working with CAD images imported into Visio.

2. Starting the selection area outside the background shape. Doesn't work well when there are other shapes in the way or when zoomed-in so edges of the background shape are off screen.

3. Protect background shape from selection. Best solution so far, but a nuisance if background shape needs to be selectable later.

Anybody have a better solution?

Thanks.
Title: Re: Area select without dragging background
Post by: wapperdude on January 06, 2009, 04:14:41 PM
I think you pretty much have hit it on the head.  Your #2 approach is the most generally used.  You can hold the shift key down and click a selected shape to de-select it.  Also not terribly convenient if you're zoomed in and can't see the selection points for verification.

The other thing you can try is using layers, but, that's not very convenient either.
Title: Re: Area select without dragging background
Post by: Visio Guy on January 07, 2009, 02:29:15 AM
Hi YD,

Yes, this is sometimes a bit maddening. Layers and background pages might help, but might also be impractical.

There's a setting under Tools > Options > General Tab  called "Select shapes partially within area", but it's almost the opposite of what you need.

With this setting, any shapes that touch the "selection rectangle" get selected. Ie: you don't have to draw a net around an entire shape to select it.

Might help in some circumstances, anyway...
Title: Re: Area select without dragging background
Post by: YossiD on January 07, 2009, 06:00:47 AM
Thanks for the replies. I was hoping there was some kind of simple solution, like a key combination that told Visio to ignore the shape under the cursor when using Area Select. Guess not.

1. I had thought of layers, but I'd never used them before and I couldn't find a quick description in the help of how to do so. In the meantime I've found some explanations and tried it out. works ok, but also inconvenient. Is there a way to get the Layer Properties dialog to stay open (similar to the Size & Position window)?

2. Also, deselecting shapes seems to be a one by one affair, and I have found some shapes, especially lines, nearly impossible to deselect. Is there a way to use Area Select to deselect?

3. A related question. Older versions of Visio clearly displayed which shapes were selected as the selections were shown individually. Newer versions indicate the entire area enclosing the selected shapes, even if there are shapes within the area that are not selected. The coloring that distinguishes selected shapes from those that aren't is not always easy to see, especially with very small shapes, and I frequently end up with unwanted shapes in selections. Is there a way to display selections the old way with current versions of Visio? I'm using 2003.
Title: Re: Area select without dragging background
Post by: cbk780 on November 02, 2011, 10:54:40 PM
I have been a Visio user for 20 years and find this the most maddening problem with the product. As a UI designer, I often have panels and windows that are behind the controls I am designing.

I have tried protection but it is so deeply buried that it is not convenient to use.

What is needed is a simple way to mark a shape and indicate that the shape should not be selectable. Obviously you need a way to reverse this as well. I think that the ideal way to do this would be a right mouse menu option that would toggle between "protect shape from selection" and "make shape selectable."

I am wondering if Visio would allow you to create some form of macro that could do this. I don;t know much about its programmatic capabilities.

Charlie
Title: Re: Area select without dragging background
Post by: Paul Herber on November 02, 2011, 11:00:52 PM
Select the shape to protect/unprotect
menu Format -> Protection
and toggle the box "From selection"
Title: Re: Area select without dragging background
Post by: cbk780 on November 03, 2011, 12:32:01 AM
Paul:

Thanks for your quick reply.

I was aware of the protection option. I took another look at it after reading your post.

One thing I noted in Visio 2010 is that you need to enable the Developer tab.

The part I always disliked about shape protection is that it requires you bring up the Drawing Explorer window. Then you need to right click at the top of the tree and bring up the Protect Document dialog. Then you need to set shape protection on.

At that point, if I understand it correctly, all shapes in the document are protected.

Now if I want to unprotect a shape, I cannot do it without going back to the Drawing Explorer dialog since the shape cannot be selected to unprotect.

So, it works but at a cost in inconvenience that is way too high. It takes about six steps to protect or unprotect a shape.

I keep hoping that Visio will correct this problem but in 20 years, it has not happened.

Perhaps this is not as big a problem for others. But when you are designing UI's it is common to have many shapes on top of each other.

Am I missing something in the way I understand this?

Best,

Charlie
Title: Re: Area select without dragging background
Post by: Paul Herber on November 03, 2011, 12:44:30 AM
You don't need the document explorer, just click on the shape.
Title: Re: Area select without dragging background
Post by: wapperdude on November 03, 2011, 12:50:36 AM
An interesting Catch22 -- set a shape so it's temporarily no selectable.  Then, later on, how do you select it to make it selectable? 

So, it needs to be some sort of toggle functionality.  The shift key kinda does that.  But, for overlaid shapes, need some means of traversing thru the vertical ordering.  The Drawing Explorer gives you the visibility, but not the toggling functionality.  Also, it's sort of hit and missing determing the correspondence between shapes listed in the DE and shapes on the drawing page.  It would seem that the necessary ingredients are present, they just haven't been setup to do the job.

Wapperdude
Title: Re: Area select without dragging background
Post by: wapperdude on November 03, 2011, 12:53:46 AM
Actually, Paul, I think you do need the DE.  Right click shape > Format > Protection > From Selection brings up another window about using the DE.  If you don't follow thru, then the shape is still selectable.  At least, that's how it is in V2003 & V2007.

Wapperdude
Title: Re: Area select without dragging background
Post by: cbk780 on November 03, 2011, 12:55:02 AM
Hi Paul:

Perhaps I am misunderstanding. If the drawing explorer is not checked, Visio displays this message "Shapes protected from selection can still be selected unless you check Shapes in the Drawing Explorer Protect Document dialog box."

And it seems to me that protection is not reversible. I cannot unprotect the shape because it cannot be selected. So the protection command is disabled. To unprotect the shape I seem to need to go to the Drawing Explorer Dialog and uncheck protect shapes. Then I can unprotect an individual shape.

It can be done but it's very clunky.

Unless I am really misunderstanding how this works.

Best,

Charlie
Title: Re: Area select without dragging background
Post by: AndyW on November 03, 2011, 08:28:00 AM
How about adding some code to your document. This catches the event for the selection change and if it is an area select, removes some shapes from the selection (in this case shapes with the text, L). This still allows your background shape to be selected as only comes into play if you are doing an area selection.



Private WithEvents vsoApp As Visio.Application

Private Sub Document_DocumentOpened( _
    ByVal doc As IVDocument)

    Set vsoApp = doc.Application
   
End Sub

Private Sub vsoApp_SelectionChanged( _
    ByVal Window As IVWindow)

    Dim vsoSelection As Visio.selection
    Dim vsoShape As Visio.Shape
    Dim lngScopeID As Long
   
    Set vsoSelection = ActiveWindow.selection
   
    lngScopeID = vsoApp.CurrentScope
   
    If lngScopeID = 1210 Then   'Area Select
   
        For i = vsoSelection.Count To 1 Step -1
       
            Set vsoShape = vsoSelection(i)
           
            If vsoShape.Text = "L" Then
           
                Call ActiveWindow.Select(vsoShape, visDeselect)
               
            End If
           
        Next
   
    End If
   
End Sub

Title: Re: Area select without dragging background
Post by: Visio Guy on November 03, 2011, 08:50:06 AM
If you are using Visio 2010, there is a new feature that allows you to turn off "quick drag" for specific areas within a shape. The new Containers use this, so that you can put shapes inside a container, yet still drag-select them without selecting the background container.

Each Geometry section in the ShapeSheet now has a GeometryN.NoQuickDrag cell. Set this to TRUE, and the area enclosed by the geometry is no longer selectable. You have to click on the border of the geometry, or drag select the whole shape.

For non-Visio-2010 solutions, I've resorted to background pages--even linking filled areas on the background to non-filled outlines on the foreground page, so that the background shapes moved and sized to stay in synch with the foreground.
Title: Re: Area select without dragging background
Post by: Paul Herber on November 03, 2011, 09:20:21 AM
Quote from: cbk780 on November 03, 2011, 12:55:02 AM
Hi Paul:

Perhaps I am misunderstanding. If the drawing explorer is not checked, Visio displays this message "Shapes protected from selection can still be selected unless you check Shapes in the Drawing Explorer Protect Document dialog box."

Oops, I should have tried it first! Sorry.
Title: Re: Area select without dragging background
Post by: Gregory Jackson on November 03, 2011, 09:56:52 PM
Well I use panels/sectionals/background how ever you want to describe them. The quickest way to do this is Layers. Once you start using layers you will come to love them.. solves your issue quickly. OR you can select everything including the box then hold down the CTRL key and deselect the background box.

But really I think layers is the best way to go.. just my 2 cents

Good Luck...
Title: Re: Area select without dragging background
Post by: tomscrace@gmail.com on June 30, 2022, 09:28:48 PM
Using the Lasso tool is pretty good for selecting items... but still doesn't get you what you need.
Title: Re: Area select without dragging background
Post by: vojo on July 01, 2022, 12:54:27 AM
I suppose the CTLR+clk...clk...clk does not address your need?
Title: Re: Area select without dragging background
Post by: Yacine on July 01, 2022, 06:51:08 AM
I think the problem is not doing CTLR+clk...clk...clk, but to do it over and over again.

In Jupyterlab I help myself by defining lists of shapes.

eg:
myRedShapes = list(vWin.Selection)
myBlueShapes ...

and reusing them - eg:
[vWin.Select(shp,visSelect) for shp in myRedShapes]

or

for shp in myBlueShapes:
  shp.Cells(xyz).Formula = 123

so far for the unuseful REPL functionality of Jupyterlab ( ;) ).


For VBA I thought about writing a modeless form with a list holding lists of shapes.
There would be a "save selection as..." button, probably also a delete and a re-define one.
Selecting an item in the list would select the according shapes.
The list items would be stored in the shapesheet of the doc or the page.

There would be also a possibility to have dynamic lists - that is where you define a condition instead of having a fixed list.

The selection routine will need to cover the case when shapes are deleted and update the item accordingly.

... unfortunately I have it already in Jupyterlab, so my motivation to write it in VBA is not the highest.
--> could be something for Paul's tool collection


Continuation here:
http://visguy.com/vgforum/index.php?topic=9904.msg45283#msg45283 (http://visguy.com/vgforum/index.php?topic=9904.msg45283#msg45283)
Title: Re: Area select without dragging background
Post by: Yacine on July 01, 2022, 07:06:52 AM
... by the way, there's one option which has been named already but not described in the depth it deserves.

Put the background shapes on a "background" layer, then depending upon the situation lock or unlock it. That's 3 mouse clicks away.
Title: Re: Area select without dragging background
Post by: sanaustoniotx on September 01, 2022, 05:23:56 PM
I just dragged the background shape out of the way temporarily and then moved it back. Only reason I needed to do this was to group a million little shapes together and create one object. I like the background layer idea though so I'll try that next time.
Title: Re: Area select without dragging background
Post by: truman69 on September 06, 2022, 07:33:28 AM
Interesting information