Reduce Number of Shapes in Org Chart

Started by KCinMelbourne, August 06, 2018, 04:54:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

KCinMelbourne

Hi all,

I'm new to Visio so please let me know if this question is unclear.

I'm building an org chart with the intent of carrying it across to PowerBI.  The org chart has less than 300 people so I expected would have only 300 shapes (double that if it includes the connectors). When I add the shapes to a layer though, it's telling me there are what equates to 10 shapes per resource. I have only been able to reduce the number of shapes by deleting the photo which makes it 9 shapes per resource.  As there is a limit of 1000 shapes in order to display a Visio diagram in PowerBI, this is a show stopper. 

Any advice on how to reduce the 'number of shapes' would be appreciated.

Thanks
KC

Yacine

Even if you reduce each entity to 1 shape, you're - with 300 people - far over the limit of 100 shapes anyway.
So the task should rather be to increase the limit of 100, isn't it?
Yacine

KCinMelbourne

Apologies, a typo. Permitted 1000 shapes.  I've now corrected.

Hey Ken

KC:

   Rather than a technical solution, how about a topology solution?  For example, you could break it up into several smaller ones, such as one per department, then string them all together once you get them into PowerBI.  I did something similar when I ran into the Visio limit for a drawing size by breaking it up into manageable pieces.  A pain, but better than nothing.

   Good luck!

   - Ken
Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

Yacine

#4
For the sole purpose of exporting the data, you can replace the shapes by simpler ones by means of a macro.

Sub replaceShapes()

    Dim shp As Shape
    Dim sel As Selection
   
    Application.ActiveDocument.SaveAsEx "C:\Temp\Temp.vsd", visSaveAsWS + visSaveAsListInMRU
    openBlocksStencil
   
    ActiveWindow.SelectAll
    Set sel = ActiveWindow.Selection
   
    For i = sel.Count To 1 Step -1
        Set shp = sel(i)
        Debug.Print shp.ID
        If shp.CellExistsU("user.msvReplaceClass", visExistsAnywhere) Then
            shp.Cells("user.msvReplaceClass").FormulaU = Chr(34) & Chr(34)
            shp.ReplaceShape Application.Documents.Item("BLOCK_M.VSSX").Masters.ItemU("Box")
           
        End If
    Next i

End Sub

Sub openBlocksStencil()
    On Error Resume Next
    Application.Documents.OpenEx "block_m.vssx", visOpenRO + visOpenDocked
End Sub


I made sure to save the current file as temporary in c:\temp. You may want to put more safety in that line of code.
The macro needed to make sure that the organigram shapes can be replaced by ones not belonging to the special addin. That are the lines with "msvReplaceClass".
The result is a drawing where every organigram entity gets replaced by a simple rectangle. The new rectangles get the shape data of the original shape ... as long as they have a value!
The replacement removed somehow the connectors. I don't know if you need them in the other app. You could either code the dependencies in an extra field, or handle by yourselves (code) the connectors.

HTH,
Y.
PS: instead of replacing the shapes, you can also delete all the sub-shapes. eg: for each subShp in shp.shapes / subshp.delete
Yacine