Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: Yacine on June 10, 2010, 07:15:15 AM

Title: Visio "Eraser Tool"
Post by: Yacine on June 10, 2010, 07:15:15 AM
I read this old topic (http://visguy.com/vgforum/index.php?topic=1248.0) and thought that I can't really agree with Visio Guy...

call a macro from the XFMod event and erase your shape from shapes underneath it:
Sub move(Shp As Visio.Shape)
Dim ShpToCut As Visio.Selection
Dim temp3 As Visio.Shape
a = 1
x = Shp.Cells("pinx")
y = Shp.Cells("piny")
w = Shp.Cells("Width")
h = Shp.Cells("height")
    ActiveWindow.DeselectAll
Set ShpToCut = Shp.SpatialNeighbors(visSpatialOverlap + visSpatialTouching + visSpatialContain + visSpatialContainedIn, 0.1, visSpatialFrontToBack)
If ShpToCut.Count > 0 Then
    Set temp = ActivePage.DrawOval(x - w / 2, y - h / 2, x + w / 2, y + w / 2)
    For i = 1 To ShpToCut.Count
        Debug.Print ShpToCut.Item(i).ID
        ActiveWindow.Select ShpToCut.Item(i), visSelect
    Next i
        ActiveWindow.Select temp, visSelect
        Application.ActiveWindow.Selection.Fragment
    Shp.BringToFront
End If
End Sub


If I knew the names of the shapes created I could even erase the "rubber dust"  :D
Title: Re: Visio "Eraser Tool"
Post by: Noisy Cricket on July 10, 2015, 02:05:05 PM
HMM.... this could easily be a nice way to shoot holes in your boss' imported picture in Visio :)
Or anything else for that matter.

Title: Re: Visio "Eraser Tool"
Post by: Visio Guy on July 10, 2015, 04:18:31 PM
I think I wrote something long ago that did the opposite: whenever you moved a shape, and it overlapped another, they did a Union, and basically got "assimilated by the Borg". It was pretty cool...