Visio Guy

Archives => Visio 2010 Feature Requests [Read Only] => Topic started by: Zigoto on February 17, 2009, 11:32:48 PM

Title: Sort Masters on Stencils in Alphanumeric Order
Post by: Zigoto on February 17, 2009, 11:32:48 PM
This would be very pleasant to have the right-click option to sort the masters in Alphanumerical order

Ziorg77
Title: Re: Sort Masters on Stencils in Alphanumeric Order
Post by: Visio Guy on February 18, 2009, 09:28:30 AM
A-men, Ziorg!

We used to have a trick that doesn't seem to work anymore:

Shift + Select the masters in a stencil in alphabetical order. Then cut them all and re-paste. This would create them "in order" on the stencil, but it doesn't seem to work anymore.

What does work is to create a new stencil and drag each master from one stencil into the other, in whatever order you want.

Of course, if you are talking about Visio's built-in stencils, none of this matters because you are "not supposed" to modify the stencils that come with Visio (indeed it is very difficult)

Bottom line: stencils should be as rich as the Explorer window, with sortable views and filters.
Title: Re: Sort Masters on Stencils in Alphanumeric Order
Post by: Paul Herber on February 18, 2009, 11:43:48 AM
It would also be great to be able to show the full name of a master, the amount of text that can shown is a bit limited. (I know about the Icons and Details shape view).

Title: Re: Sort Masters on Stencils in Alphanumeric Order
Post by: AndyW on February 18, 2009, 12:44:24 PM
You could sort the names of the masters in the stencil, create a new stencil and then drop the sorted masters into the new stencil.



    Dim i As Integer
    Dim vsoDoc As Visio.Document
    Dim vsoDocNew As Visio.Document
    Dim dictMasters As New scripting.Dictionary
    Dim vKeys As Variant
   
    Set vsoDoc = Visio.Documents.ItemFromID(3)    'Existing Stencil
   
    Set vsoDocNew = Visio.Documents.AddEx("New Stencil.vss", , visAddStencil)    'New Sorted Stencil
   
    'Get the names of the existing masters and sort them

    For i = 1 To vsoDoc.Masters.count      
        Call dictMasters.add(vsoDoc.Masters(i).name, vsoDoc.Masters(i))  
    Next
   
    vKeys = dictMasters.Keys
   
    Call BubbleSort(vKeys)
   
    'Drop the existing masters into the new stencil based on the sorting

    For i = 1 To dictMasters.count   
       Call vsoDocNew.Masters.Drop(vsoDoc.Masters(vKeys(i - 1)), 0, 0)      
    Next


Title: Re: Sort Masters on Stencils in Alphanumeric Order
Post by: Visio Guy on February 18, 2009, 01:28:34 PM
"One" could probably make a pretty cool add-on that showed masters in a wonderful variety of ways...