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's Name bug?

Started by Mariachi41, August 17, 2011, 09:07:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mariachi41

I use C# to open a .vsd file and get shapes on one page. When I debug my code I find a problem, some shapes' Name property in the code is different from that I saw in the Format->Especial->Name. For example, one server shape's name is "server" in visio, but in the debug mode, it's "Sheet.2". This situation only appears in the "Net" template's shapes, and in other templates such as "Basic Flowchart", the code works well.

Anyone can help me with this? Thanks a lot.


Paul Herber

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

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

Mariachi41


Mariachi41

Dear Paul:

    I'v read the topics you gave, but I found my problem is different. Firstly, I only use default master of "Net" template; Secondly, in debug mode, I use a for cycle the get all the shapes, only the first shape's Name and NameU are normal, others' Name and NameU are both Sheet.X (X begin from 2).

    I've read Microsoft help document,  "If the shape is not an instance of a master, shapeName is Sheet followed by the shape's ID number. For example, Sheet.34. In this case, the Name and NameID properties of the shape return the same string." But I drag the shape from default stencil. So, WHY?
:-\

aledlund

when you drop a shape on a page, visio will assign a default name to the object. The default name uses the form sheet.xx where xx is a number that is incremented, i.e. sheet.35 was dropped on the page after sheet.34. The number is the Id number, sheet.id... After the object is on the page you get the option (via code) to rename the object using Name and NameU.
al

Browser ID: smf (is_webkit)
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: 213 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1123KB.
Tokens: post-login.
Cache hits: 12: 0.00133s for 26,766 bytes (show)
Cache misses: 1: (show)
Queries used: 15.

[Show Queries]