Re: Accessing specific shapes on a page



The first time you or a user names something, Visio assigns that name to
both the Name and NameU properties. The next time you or a user renames
something, Visio only updates the Name property. NameU can only be updated
via automation. Visio does this to support having multiple language
versions of the same shape or to allow users to rename a shape without
breaking your automation. (Of course, this assumes that your automation
exclusively works with NameU.)

I'm not sure I understand the reason why you are trying to parse a
Shape*** expression in code to find out a shape reference. Visio provides
the Connects object to get at shapes via glued connections.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"WPfeffer" <WPfeffer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:69E1863A-64A3-4B25-9D9B-BC761A911A90@xxxxxxxxxxxxxxxx
Thanks for the help. You were correct there was a problem with the Name
and
NameU properties not matching up.

How does this happen, I would really like to avoid this in the future?

Wayne

"Paul Herber" wrote:

I seems to me that you might have masters with different Name and
NameU properties. You could write some VBA to iterate through the
masters in the stencil and show you the Name and NameU properties of
each shape. Or you could try my
http://www.visio-utilities.sandrila.co.uk/
which will do it for you and offer to update the name if there is a
difference.


On Fri, 22 Jun 2007 15:56:00 -0700, WPfeffer
<WPfeffer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I am trying to access the two shapes being connected by a dynamic
connector.
When I access the '1-D Endpoints' section of the connector shape and
retrieve
the X, Y coordinates of the two ends, I am able to parse out the 'From'
shape
and the 'To' shape names that can then be used in the <shape
object>.get_ItemU(<shame name>) method of the page object.

The problem that I am currently having is:

One of my shape's master is named 'FileAcquisition' in the stencil. When
I
drop it on the drawing page and check its shape ***, the name in the
title
bar of the shape *** window is 'Rounded process'
[Drawing1:Page-1:Rounded
process <SHAPE>]. When retrieve the 'BeginX' cell from the '1-D
Endpoints'
and parse out the name, I get 'FileAcquisition', but when I check the
shape
*** the name that it has in the BeginX cell is 'Rounded process'.
[=PAR(PNT(Rounded process!Connections.RequestLocation.X,Rounded
process!Connections.RequestLocation.Y))]

Could someone please explain to me why this is happening? It's more than
just a little frustrating. The code that I'm using to parse out the
BeginX is
[shapeSubject is the connector]:

Cell cBeginX =
shapeSubject.get_CellsSRC((short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowXForm1D, (short)VisCellIndices.vis1DBeginX);

string sFromBot = ((cBeginX.Formula.Split(new string[] { "!" },
StringSplitOptions.None))[0].Split(new string[] { "(" },
StringSplitOptions.None))[2];

The formula being returned from cBeginX.Formula:
PAR(PNT(FileAcquisition!Connections.RequestLocation.X,FileAcquisition!Connections.RequestLocation.Y))

The formula in the Shape *** for the connector shape:
=PAR(PNT(Rounded process!Connections.RequestLocation.X,Rounded
process!Connections.RequestLocation.Y))


Wayne

--
Regards, Paul Herber, Sandrila Ltd. http://www.sandrila.co.uk/



.