More control over glueing

Started by RhesusMinus, April 07, 2011, 12:06:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RhesusMinus

Hi.

I have a shape with "lots" of connection points.
When connecting a 1D-shape to this shape, I want the handles on the 1D-shape to ONLY connect/glue to some specific connection points in my shape. How can I achieve this?

THL

wapperdude

Typically, you just need to zoom in.  Part of the problem is the snapping settings, and if zoomed out too far, either the grid or the ruler gradations are too coarse, preventing snapping to specific connection points.  As an alternative, you can miminze the selected snapping options or change the priority settings to put an emphasis on the connection points. 

HTH
Wapperdude
Visio 2019 Pro

Jumpy

Because I had a similar problem once, I understood the question a bit different then vojo:

If you want the user to prevent using some special CPs, you have to use a trick.
My problem was, that my shapes had CPs for (1-d-shapes symbolizing) electric-power-lines and CPs for (1-d-shapes symbolizing) water-pipes.

In the ShapeSheet I changed the linetype of the connection points, so I could use the D-Column. In it I placed either the word "power" or "water" to distinguish the CPs.

After that I had VBA monitor the connection event. After each connection I checked the type of the 1-d-shape and of the CP and if they didn't match, I undid the connection.

If your problem lies more in the area of vojos answer, forget what I wrote.

AndyW

If there are only specific connection points to which your 1-D shape is allowed to connect you will need to resort to some code. That way if you name your connection points suitably. You can catch a connection being made and although you cannot prevent the connection, you can disconnect afterwards.

Private WithEvents myVsoApp As Visio.Application

Private Sub myVsoApp_ConnectionsAdded( ByVal Connects As IVConnects)


You can then examine the connections being made and if it is not allowed disconnect your 1-D shape.
Live life with an open mind

Visio Guy

Guys,

There is a cell in the ShapeSheet that prevents "dynamic glue". For the shape with all the connection points, scroll way down to the bottom of the ShapeSheet and find the Glue Info section.

Then set:

    GlueType = 8   (visGlueTypeNoWalkingTo)

I did a quick test, and this seemed to work in Visio 2010. It also turns off the blue AutoConnect arrows for the shape in question, so you have to use the Connector Tool or drag a connector onto the page and glue it.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010