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

Legend shape - How to change description name

Started by Bogardo, March 28, 2012, 02:57:05 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Bogardo

Hello all,

I just put in a code in my custom made shapes so that the legend shape would recognize them. (User.visLegendShape, value =2).
The name the legend displays under Description is not the name I gave to the custom made shape.
I tried to change it with the following code:

Sub ChangeName()
Dim stn As Visio.Document
Set stn = Visio.Documents("Stencil.vss")
Dim mst As Visio.Master
For Each mst In stn.Masters
mst.NameU = mst.Name
Next
End Sub


I opened the stencil (red star next to it) and run the code without effect. It still shows a number after the name. Any ideas?
Is there a way to have bigger symbols in the legend?

Paul Herber

If the shapes are already on your drawing then you need to do the name updte on the document stencil, i.e. the masters already within the document.
Here is a page showing how to do this:
http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/

Do your renaming within a loop of all the masters.
P.S. add an error trap around the rename just in case it fails.
Electronic and Electrical engineering, business and software stencils for Visio -

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

Bogardo

Quote from: Paul Herber on March 28, 2012, 03:12:24 PM
If the shapes are already on your drawing then you need to do the name updte on the document stencil, i.e. the masters already within the document.
Here is a page showing how to do this:
http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/

Do your renaming within a loop of all the masters.
P.S. add an error trap around the rename just in case it fails.
I don'get it. I did as shown in your link but nothing changes. Maybe I don't fully understand it, I'm quiet new in this stuff you know.
A step by step guide would do the trick I guess. Below an image of the problem:
The shape I dragged from the stencil into the drawing area is present in the legend  but the names aren't the same and definitely not "RQ60 AUMHE 230" as it should be.
When I drag another shape into the drawing, same problem. Quantity will be "2" in the legend but both shapes have different names (RQ60 AUMHE 230.157 & RQ60 AUMHE 230. 354). The name in the legend stays RQ60 AUMHE 230.134 .

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: 186 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1053KB.
Tokens: post-login.
Cache hits: 13: 0.00107s for 26,762 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]