Masters Stencil

A

Andy Hough

Hi all,

I was wondering if it is possible to find which stencil a master
belongs to, especially if you have more than 1 stencil associated with
a drawing where the master name is the same, e.g. you use the flow cart
stencil which has a master called "Data", plus a custom stencil which
also has a "Data" master.

Looking through the Master properties, there doesn't seem to be a
reference to the Master's stencil.

Any help gratefully received!!!

Thanks

Andy
 
M

Mark Nelson [MS]

Visio does not track this information. When you drag a shape from a stencil
into the drawing, Visio creates a local copy of the master. That way the
drawing is not dependent on the original stencil being present just to show
the shape instance. In other words, the document data is self-contained.

You can find out what master a shape on the drawing derives from. Use the
Shape.Master property.
 
M

Mike Z

Hello Mark,

Wondering whether you can help me on a Visio 2003 and Visio 2002
compatibility issue.

I've been programming against Visio 2000/2002 for a few years. I have used a
VS. file as a template to host a document stencils and to provide drawing
pages. It has been working just fine till I tested it lately with Visio
2003. I can still invoke Visio 2003, create graphics, and save to a (custom)
file as usual. However, when I load back the same file which include a set
of objects that match the stencils in the VS. file, the graphics seemed to
zoom in unlimitedly and created a mess.

Could you please spend some thoughts on this issue, as it's been critical to
our products?

Thanks you,

Mike
 
A

Andy Hough

Mark said:
Visio does not track this information. When you drag a shape from a
stencil into the drawing, Visio creates a local copy of the master.
That way the drawing is not dependent on the original stencil being
present just to show the shape instance. In other words, the
document data is self-contained.

You can find out what master a shape on the drawing derives from.
Use the Shape.Master property.

Thanks for the reply Mark,

My scenario is that I'm building a .Net addin and when a shape gets
dropped from my custom stencil I act accordingly depending on the
Master's Name. Therefore when you drop a shape from another stencil
that has the same Master name, things can get tricky. Thinking about it
I suppose I could put a unique row in the User section and validate the
shape from there - just seems a bit long-winded!!!!!!
 
M

Mark Nelson [MS]

Visio actually does not allow two masters to have the same name in the same
document. If there is a master named FOO on your custom stencil and a
different master named FOO on another stencil, the first one dropped into
the document wins. It is named FOO in the document. If you then drag in
the other master, it will be renamed FOO.1.

You can change this behavior if you set the MatchMasterByName property on
the master. Then as long as your custom stencil master was the first to
come into the document, dragging a different master with the same name would
still result in an instance of the original master. One way to guarantee
that your master is first is to go ahead and put copies of your master
shapes into the Document Stencil of the drawing template.

The downside of MatchMasterByName is that you cannot revise your custom
stencil master and use that newer version in existing documents. The
setting will keep forcing any new shapes to derive from the original master.
 
M

Mark Nelson [MS]

Hi Mike,

I'm not sure that I understand what you are talking about, but you might
want to check out the new DropOnPageScale shapesheet cell and see if that is
somehow affecting you.

--
Mark Nelson
Microsoft Corporation

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

Mike Z

Hi Mark,

Thanks for the reply!

I asked you a similar, though much detailed, question in another occasion.
Sorry for the duplicate, but I've been in need to figure out it soon.

I believe you're right this problem may have something to do with the scale.
However, I couldn't find the DropOnPageScale cell in the shapesheet and
wonder whether it's called a different term instead. Also FYI, I've been
using millimeter (mm) as the units for the drawing.

Are you aware of any differences of the page's Drop function between version
2002 and 2003?

Thanks again,

Mike
 

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