News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Visio "Eraser Tool"

Started by Yacine, June 10, 2010, 07:15:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

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:
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
Yacine

Noisy Cricket

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

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

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 186 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1098KB.
Tokens: post-login.
Cache hits: 14: 0.00268s for 26,731 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]