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

Shape Sheet Names

Started by mmulvenna, January 23, 2009, 04:06:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mmulvenna

Hi,

Have been using visio for about 6 months now. Today I decided to add a name to all my the shapes. ie
  Shape.name = "rear spacer". When I did that all formulas in all sheets continued to work properly even though they used to contain "sheet.21"(example). Visio changed all formulas to names rather than sheet numbers

example in sheet.22 the pinx formula used to say "=guard(sheet.21!pinx)"

After I updated the .name property the pinx formula automatically chaged to
"=guard(rear spacer!pinx)" and everthing continued to work properly.


I made the .name changes with vba with values from a database.
First question....When did visio change all references from "sheet.21" to "rear spacer"?

I then manually changed the pinx formula to "guard(front spacer!pinx)" This would have been the old "Sheet.24" and the expected results were achieved. Pinx moved appropriately.

In the explorer window it now shows the name properties rather than the "sheet.nn"

I next changed the "name" proprty of "sheet.24" to "mike". "Mike" now displays in the explorer window for
"sheet.24" but the pnix formula still shows "guard(front spacer!pinx)" and the shape is positioned properly even though the fomula has the old name in it.

Can anyone explain this? Even though the formulas reference shape.names is visio really using shape.id in the formula?

Thanks in advance
Mike

Visio Guy

Mike,

Is sheet.24 a sub-shape of sheet.21?

Visio "friendly" naming only works at the same scope level - ie: at the same level of grouping.

So all the shapes on a page can refer to each other by SheetID or by Name, but a sub-shape inside a group can't refer to a page-level shape by name. It has to use the SheetID form.

On the other side, for any given scope, names are unique. So every shape on a page could have a sub-shape named "TextBlock" or "Bob", and they wouldn't get changed to "TextBlock.2" or "Bob.34", as happens when you try to give duplicate names in the same scope.

Hope this makes sense,

Chris

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

mmulvenna

No, the sheets are all the same level. They are in a group shape but 21 and 24 are the same scope. Everything is working okay, just wondering why it is when the friendly name is an old one. That is what lead me to believe that the formulas are really using the .id rather than the friendly name. All my VBA code still uses .id and it works as it always did.

Thanks
Mike

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: 188 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1058KB.
Tokens: post-login.
Cache hits: 13: 0.00170s for 26,727 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]