Making blocks with perspective transparent.

Started by Gate, March 16, 2009, 12:15:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


My current drawings include many blocks with perspective. Now I need to make some of them transparent.

The face of the block becomes transparent, but the top and sides do not. How do I make the entire shape transparent?



Welcome Gate,

Are you using the Visio perspective blocks? If so, these blocks are groups that are made up out of different shapes. By default the group is locked so it looks like its just one shape. To make the top etc transparent you will first need to use the shapesheet of the group to change the group properties, and set selectmode to 1 instead of 0. This will allow you to sellect the parts of the shape you need to make transparent (eg the top). By selecting these and going into the shapesheet again (because the shape is guarded against changes) you can set the Fill Format property FillForegroundTrans, default is 0% (solid), setting it to 100% will make it completely transparent.

Hope this helps,



Thanks Lars.

Took a few tries, but I did it. Takes three trips to the shapesheet, right? Or is there a less clunky way?

If anyone else wants to know how to do this, let them learn from my mistakes. The first couple times, I made the face of the cube transparent before visiting the style sheet. That makes the line disappear and there's no easy way to get it back.


also you might try it with a macro something like this


Option Explicit

Public Sub makeShapeTransparent()

        Dim visWin As Visio.Window
        Set visWin = Application.ActiveWindow
        Dim dghShape As Visio.Shape
        Dim selShapes As Visio.Selection
        Set selShapes = visWin.Selection
        If selShapes.Count = 1 Then

            Set dghShape = selShapes(1)
            ' set it semi-transparent
            Dim strTrans As String
            strTrans = "50%"
            ' first the fill properties
            recurseApplyCellFormula dghShape, visSectionObject, visRowFill, visFillForegndTrans, strTrans
            recurseApplyCellFormula dghShape, visSectionObject, visRowFill, visFillBkgndTrans, strTrans
            ' then the line properties
            recurseApplyCellFormula dghShape, visSectionObject, visRowLine, visLineColorTrans, strTrans

        End If

End Sub

' some of the shapes that are used are groups of groups, so the need
' is to change not only the top level shape but those that are grouped
' inside as well
Private Sub recurseApplyCellFormula _
    (ByVal visShape As Visio.Shape, _
    ByVal intSection As Integer, _
    ByVal intRow As Integer, _
    ByVal intCell As Integer, _
    ByVal strFormula As String)
    On Error GoTo ErrHandler
    Dim visCell As Visio.Cell
    ' set transparency of the shape
    If visShape.CellsSRCExists(intSection, intRow, intCell, 0) = True Then
        Set visCell = visShape.CellsSRC(intSection, intRow, intCell)
        visCell.FormulaU = strFormula
    End If
    ' if embedded shapes exist, recurse through them also
    Dim visEmbShape As Visio.Shape
    Set visEmbShape = Nothing
    If visShape.Type = visTypeGroup Then
        For Each visEmbShape In visShape.Shapes
            recurseApplyCellFormula visEmbShape, intSection, intRow, intCell, strFormula
        Next visEmbShape
    End If
    Exit Sub


    If Err.Number = -2032466648 Then
        Resume Next
        ' might want to know which shapes and cells are giving us problems
        Debug.Print Err.Number & " " & Err.Description & " " & visShape.Name & " " & visCell.Name
        Resume Next
    End If

End Sub

Visio Guy

Very cool, Al!

I especially like your GUARD detector:

    If Err.Number = -2032466648 Then
        Resume Next

For articles, tips and free content, see the Visio Guy Website at
Get my Visio Book! Using Microsoft Visio 2010


as a note, by adding this before calling the recurse function you gain the ability to start globally applying format changes to data graphics. That's how I was changing the text attributes in the drawing I sent you.

    ' unlock the groups so we can change the font sizes
    recurseApplyCellFormula visShape, visSectionObject, visRowLock, visLockGroup, "0"