Author Topic: Visio "Eraser Tool"  (Read 23085 times)

0 Members and 1 Guest are viewing this topic.

Yacine

  • Hero Member
  • *****
  • Posts: 3164
Visio "Eraser Tool"
« on: June 10, 2010, 02:15:15 AM »
I read this old topic 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:
Code
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
« Last Edit: August 12, 2010, 07:46:13 AM by Visio Guy »
Yacine

Noisy Cricket

  • Jr. Member
  • **
  • Posts: 63
Re: Visio "Eraser Tool"
« Reply #1 on: July 10, 2015, 09:05:05 AM »
HMM.... this could easily be a nice way to shoot holes in your boss' imported picture in Visio :)
Or anything else for that matter.


Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1737
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Visio "Eraser Tool"
« Reply #2 on: July 10, 2015, 11:18:31 AM »
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...
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010