How to share a master stencil across a number of documents

Started by Andrew N, March 30, 2009, 05:00:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew N

Hi,

First time poster here!  I have a project with two people are working on concurrently.  I have set up a document stencil in a file so I can re-use wireframes in multiple places in the same document, so that updating the master shape updates the shape throughout the doc.  The master shapes are likely to change regularly.  This works fine.

The question is what is the most efficient way of having a number of people work on the doc simultaneously?

1) Set up separate documents for each person that all refer to the same document stencil?  (I don't know how to do this).

2) Cutting and pasting work into the master doc from each person (painful)

3) Using a 3rd party batch utility to move pages to the master doc.  The master elements are somehow updated in the process and reflect those of the master doc (this process only creates fresh master objects for me).

4) Or something else?

Thank you!

Andrew N

Visio Guy

Hi Andrew,

That's a good question. Unfortunately, there's no real way to have a "global stencil" that can push updates into documents. Once a master is dragged into a drawing, it gets copied to the local, document stencil as you have explored. Changes to the external stencil's masters won't propagate into the drawing after that.

If folks don't need to simultaneously work on the document, you could just share it on the network.

There are master-updating utilities, but I can't say much about how well they work. It is a tricky task to do properly and there are lots of pitfalls for even the best tools. Have a look at this thread for talk about those tools: Update/Replace Shapes Addon

I think a macro/custom code that merges pages into documents might work well. You can configure masters such that they "match by name", meaning the target document's versions will be the "winner" on drop. The less sophisticated or hacky your shapes are, the better this will work. (I mean less full of tricky ShapeSheet stuff, not how good they look)

Hope this helps,

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

Andrew N

Thanks for your helpful reply Chris.

OK so I am trying to use the 'match by name' idea that you mention.

I just set up a test.

1) I created a document (Document 1) with one master shape on it's document stencil called 'Box'.
2) I right clicked on the 'Box' master shape, chose Master Properties, and checked the 'Match Master by Name on Drop' checkbox.
3) I drag the master shape onto the empty document, and then copy it.
4) I then create a new document (Document 2).  I paste the copied shape into this new document. A new master shape called 'Box' appears on this document, as expected
5) I double click 'Box' in 'Document 2', and change the text inside it.  The instance on the page updates.
6) I cut and paste this altered shape back to 'Document 1'.  A new master shape appears alongside 'Box' called 'Box.2'.

What I expected to happen is that 'the target document's versions will be the "winner" on drop.', but instead a new master is created (box.2)  This 'match' feature doesn't seem to be happening.

Am I misunderstanding something?

Thanks!  Andrew

Visio Guy

You understand correctly. Whenever you see a ".2" type of naming, that means the name wasn't being matched.

It may be that your target document's master isn't set up properly after all, but you seem to know what you're doing. Have a second look in the Document Stencil just in case.

There is also some weirdness with Name vs. NameU. Each master can have two names. A local name (Name) and a universal name (NameU). This helps with localization, for instance:

  My US Stencil
  Master.Name = Circle
  Master.NameU = Circle

  My German Stencil
  Master.Name = Kreis
  Master.NameU = Circle

I created a test. In the outside stencil, I made a master "Steve" and dragged it into a drawing. "Steve" is set to match by name.

Then I renamed "Steve" to "Stefano" in the external stencil, and changed the "Steve" master in the document. When I drag "Stefano" into the document, it does a match-by-name and picks up "Steve". Clearly Visio is matching the NameU here. "Stefano" still has a NameU of "Steve". The first name you give a master becomes it's NameU *forever* (until you change it using automation code)

Now it gets weird.

In the external stencil, I made a new, empty master called "Steve". So now, this stencil has "Stefano" and "Steve". "Steve" is empty, and dragging an empty master into a doc usually results in an error. But when I drag the new "Steve" into the document, it picks up on the "Steve" that is already there. So two masters in the external stencil successfully match-by-name in the target document, due to NameU presumably.

As a clean-up task, it might be good to set all NameUs equal to NameU. You can do this with a short VBA script. It might be good if you try it on your documents to see if this fixes the problem:


'// Set master NameUs to Name
Dim mst as Visio.Master
Dim doc as Visio.Document
Set doc = ThisDocument '...or some document, perhaps Visio.ActiveDocument
For Each mst in doc.Masters
mst.NameU = mst.Name
Next mst


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

Andrew N

Thanks again Chris for your patience with this.  I tried the script but to no avail.  Providing I do not change either of the masters, copying the shape that is associated with the identical master name from one document to the other does NOT create a new master.   However as soon as I edit one or other of the masters copying creates a new master.

My goal is to be able to move pages from one doc to another, keeping most of the content, but having any objects associated to a master object that matches a master object in the target doc update to the target doc's master.

Cheers,

Andrew

Visio Guy

Hi Andrew,

Maybe you can create a very simple system of two documents that are having the problem and zip/upload them here for others to try so we can see if we can help.

- 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

Andrew N

Sure - here are two files.  Test 1 is the original. A master shape is created, copied to 'Test 2'.  I have edited the master in test 2, and copied back - you see a new master in the document stencil.

Cheers, Andrew

Visio Guy

Ok, I see what is happening. This is not what I expected.

Curiously, if you drag the master from Test2's stencil back into Test1, then you see the effect that I have been going on and on about - ie: the Home Field Master wins.

But it is not working for instances (shapes on the page)
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Andrew N

Damn.  I think my only solution is to resort to painful selection, cutting and pasting or staggering access to the document.

Visio Guy

Yeah, I'm bummed that the master thing isn't working as I expected. Quite a surprise.

Two other options:

1. Automation (ala: VBA, VB.NET, C#)
2. Visio's XML format. It might be possible to cleverly merge pages in this way, but still pick up the newer, or "home field" masters
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010