why it is renamed

  • Thread starter visio developer vba
  • Start date
V

visio developer vba

Hello everybody:
I created a Stencils and add a Shape of Connector named Conncetor in it.
When i drag one, it's name will be
Connector. & number (like Connector.70).i drag the second ,it's name will be
Connector. & another number(like Connector.72). but when i drag a lot of it,
it's name will be sheet. & number(like sheet.70). why? i can not catch it.so
untraceable!
 
D

David Parker

Firstly, I always synchronise the name of my master with the name of the
shape in the master, so check that they are both called "Connector".

Secondly, ensure that the "Match Master By Name" setting is checked for the
Master.

Thirdly, you can always use the Shape.Master reference in code to see if it
is truly an instance

Fourthly, the shape name can be anything you want it to be (upto 31
charcters) - You may want to consider renaming automatically in code to
something more meaningful.
 
T

top teach

Firstly Thank you very much!
Can you tell me about your second step£¿ what is the means about the
 
T

top teach

Firstly Thank you very much!
Can you tell me about your second method£¿ what is the means about the
Settings("Match master by name on drop" and "Generate icon automatically
from shape data"). I have not understood the two Settings. And in your
Thirdly method , the shape.Name property is not only be read but also be
written? just like shape.Text property???
Thanks for your help!
 
D

David Parker

Whenever you drag a master from a stencil onto your drawing page, a local
copy is created in the document stencil, if it doesn't exist already.
However, if you amend the local copy, or bring in a similar named master
from another stencil, then you may accidently create a duplicate master.
These can be recognised on the local document stencil because they have .nn
at the end of the name, where nn is a number.

As an example, drag and drop the Space master from the Resources stencil,
and then the Space master from the Walls, Doors and Windows stencil. if you
show the document stencil (File\Shapes\Show Document Stencil) then you will
see that there are now two masters, one called Space, the other called
Space.nn. This is not good and in my opinion sloppy programming by firslty
Visio, and then Microsoft. If they had bothered to check Match master by
name on drop on the Master edit dialog (right mouse click on the Master in
the stencil, select Edit Master \ Master Properties), then there would have
been only one Master on the document stencil, and normal users wouldn't be
confused and the Master \ Instance relationship would be intact. The
drawing file size is increased in this example, because there are more
masters than necessary.

And, yes, the name of a shape can be changed to whatever you like, as long
as you don't use special characters, and you use a maximum of 31 characters.
You can do this manually by selecting the Format\Special dialog from the
right mouse click on a shape, or you can do it code (myShape.Name = xxx).
One further rule is that the name must be unique for the collection that it
is within, for example on the same page. This is useful, for example, if
you create a grouped shape, and you want to refer to a sub-shape in code.
If you give the sub-shape a name, say Widget, then every instance of that
shape will have a sub-shape called Widget. This is because the name is
unique within the parent collection. Naming shapes make using the Drawing
Explorer Window far more intuitive.

David Parker
bVisual ltd
www.bVisual.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top