Author Topic: Sort Masters on Stencils in Alphanumeric Order  (Read 8833 times)

0 Members and 1 Guest are viewing this topic.

Zigoto

  • Jr. Member
  • **
  • Posts: 16
Sort Masters on Stencils in Alphanumeric Order
« on: February 17, 2009, 06:32:48 PM »
This would be very pleasant to have the right-click option to sort the masters in Alphanumerical order

Ziorg77
« Last Edit: February 18, 2009, 10:05:26 AM by Visio Guy »

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1716
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Sort Masters on Stencils in Alphanumeric Order
« Reply #1 on: February 18, 2009, 04: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.
« Last Edit: February 18, 2009, 10:04:42 AM by Visio Guy »
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2932
    • Paul Herber's website
Re: Sort Masters on Stencils in Alphanumeric Order
« Reply #2 on: February 18, 2009, 06: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).

« Last Edit: February 18, 2009, 10:05:35 AM by Visio Guy »
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

AndyW

  • Sr. Member
  • ****
  • Posts: 320
    • PC Mimic Diagram
Re: Sort Masters on Stencils in Alphanumeric Order
« Reply #3 on: February 18, 2009, 07:44:24 AM »
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.

Code

    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

« Last Edit: March 30, 2009, 08:14:11 AM by Visio Guy »
Live life with an open mind

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1716
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Sort Masters on Stencils in Alphanumeric Order
« Reply #4 on: February 18, 2009, 08:28:34 AM »
"One" could probably make a pretty cool add-on that showed masters in a wonderful variety of ways...
« Last Edit: February 18, 2009, 10:05:14 AM by Visio Guy »
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010