Visio 2003 - Org Chart from Excel Ignores Modified Masters in Document Stencil

G

google

Hi all. I've been banging my head against the wall here, and would
certainly appreciate a hand.

I'm working on a reasonably-sized org chart of 400 companies using the
Org Chart US Units template & stencil. The source is an Excel sheet
with a combination of entered text, numbers, and formulas. Some of the
columns are used to modify the appearance of the shape instance, for
example, if the parent company is A, then the outline is regular black.
But if it's B, then the outline is blue. Or if another value is C,
then the shape is a regular rectangle, but if it's D, the corners are
rounded to become a rectangle.

I've made a number of changes in the master shapes in the document
stencil. (In fact, I don't use the "official" stencil at all, and I
really wish I could make it stop loading and filling my document
stencil with shapes I don't want and haven't used each time I open the
diagram.)

Imports are done by erasing all shapes on the current page and running
Organization Chart --> Import Organization Data. Similar results occur
if the Master Shape is copied into a new document and the process is
repeated.

There's a fair bit of text in some of the shapes, so I want to increase
their size. In the Document Stencil's copy of the Master Shape of
Position, the formula for Height is SETATREF(User.Height). So I
changed User.Height from 0.5 in*DropOnPageScale to 1
in*DropOnPageScale. The master window shows exactly what it should - a
taller shape. When I save and update, none of the instances of
Position grow in height. Checking a ShapeSheet indicates the
User.Height cell still has the formula of 0.5 in*DropOnPageScale. This
doesn't update even after the shapes are re-imported or fiddled with in
the drawing window. (User.Width behaves similarly. I've set it to 1
in*DropOnPageScale in the ShapeSheet, but a random shape has the
formula of 1
in*IF(AND(GetVal(User.DocShowPicture),GetVal(User.ShowPicture),GetVal(User.HasPicture)),1.5,1)*DropOnPageScale
which is the stencil default.)

Another example: In the spreadsheet, there's a column specifiying the
layer membership. The formula evaluates to something like 0;3;5 for
membership in those layers. It goes into a ShapeSheet cell called
Prop.Layers as "0;3;5". In the Master's Layer Membership section, the
formula SETATREF(Prop.Layers) should set the shape's layer value at
creation or refresh. But picking a random shape shows that despite a
value of "0;3;5" in Prop.Layers, Layer Membership is simply "". The
View Layers dialog indicates there are 1072 shapes in layer 0 (and none
elsewhere), but Select By Type finds nothing when I ask it to locate
anything in layer 0.

(I've worked around this with:

Sub SetAllLayers()
Dim MyShape As Shape

For Each MyShape In ActivePage.Shapes

If MyShape.Master.Name = "Position" _
Or MyShape.Master.Name = "Manager" _
Or MyShape.Master.Name = "Executive" Then

MyShape.CellsSRC(visSectionObject, visRowLayerMem, _
visLayerMember).FormulaU = "Prop.Layers"

End If

Next MyShape

End Sub

but I don't want to depend on code, because someone would need to
remember to run it.)

Some things work fine. In FillFormat.FillForeground, I refer to
Prop.ocwiz_14, which contains an RGB function. In
LineFormat.LineColor, a combination of IF and STRSAME finds a value in
another cell and appropriately chooses a LineColor for the shape.
There are others too. Modifying the master, e.g. rotating the shape,
causes all shapes on the sheet to rotate as well, so there is a
definite link remaining.

Auuuuuggghhh!!!!

Thanks in advance!

Neman Syed
neman@*YOUKNOWWHATTODOWITHTHISPART*istcd.com
http://www.istcd.com
 
M

Mark Nelson [MS]

The problem you are encountered has to do with inheritance between masters
and shape instances. When you drag out a shape from a stencil, you are
creating a shape instance from the master in the stencil. Initially all the
properties (i.e. Shapesheet cells) on the shape instance inherit their
values from the master shape. This means that if the cell in the master
shape changes, the cell in the shape instance changes too.

However, it is possible for the user (or the Org Chart application) to make
changes directly on the shape instance. Visio automatically changes the
PinX and PinY cells to match the position of the shape instance on the page.
If you change the fill or line color, those cells get changed on the shape
instance. Once a cell is set in the shape instance, that cell no longer
inherits from the cell in the master. Thus your master changes do not
propagate.

In your case, the Org Chart application is changing the User.Width and
User.Height cells as the shape instance is dropped on the page.

However, in the case of shape size and a few other settings, you can specify
what you want directly in the Organization Chart > Options dialog. No
master editing is required.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

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

google

Gotcha. So the inheritance could either be taking place from my
modified shape and then the Org Chart app is overwriting it, or the Org
Chart gets its info from the "official" shapes and only some of my
modified shapes' properties come through after the fact. If the
latter, it seems impossible to predict which will work and which won't.
Quelle drag...

Either way, it looks like a code-based "cleanup" approach after the
import will be required. I want my end users to have to do as little
as possible, a sort of "step 1 -- import, step 2 -- click the magic
button" approach.

Thanks though Mark! Now I just need to ice my head. :)

Neman Syed
neman@*YOUKNOWWHATTODOWITHTHISPART*istcd.com
http://www.istcd.com
 

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