News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Sort Masters on Stencils in Alphanumeric Order

Started by Zigoto, February 17, 2009, 11:32:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zigoto

This would be very pleasant to have the right-click option to sort the masters in Alphanumerical order

Ziorg77

Visio Guy

#1
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.
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

#2
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).

Electronic and Electrical engineering, business and software stencils for Visio -

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

AndyW

#3
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


Live life with an open mind

Visio Guy

#4
"One" could probably make a pretty cool add-on that showed masters in a wonderful variety of ways...
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 229 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1116KB.
Tokens: post-login.
Cache hits: 13: 0.00168s for 26,726 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]