Restrict glue settings for a shape

Started by MacGyver, September 10, 2012, 11:52:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MacGyver

Is it at all possible to limit what shapes can glue to what shapes? 

I have a number of shapes placed on top of each other and i would like my reference bubbles to be unable to glue to the bottom shape, 'Shp X'.  Unfortunately Shp X has a large number of connection points and the reference bubbles often glue to this Shp X instead of the desired shapes.  I can't place Shp X on a separate layer and turn off gluing because I glue other shapes (non reference bubble shapes) to Shp X

Any ideas or suggestions?

wapperdude

I don't know of any way to explicitly rule out a specific shape for snapping or gluing.

What you might do, is give your bubbles a alternative preference.  Of course, that  means all other shapes would have the same gluing preference as a side effect.  But, what you might do is drag a guide from the rulers onto the drawing and center it where you'd like the bubbles to be.  Then, under the tools>snap&glue>advanced increase the strength of gluing to the guide.  This will cause the bubble to glue to the guide rather than your bottom shape.  Then, drag the guide to position the bubbles as desired and finally, eliminate the guide.  The bubbles should stay put.

But this may create additional side-effect problems and may not be practical or useful.  It's the 1st thing that came to mind.

Wapperdude
Visio 2019 Pro

MacGyver

appreciate the quick response wrapper dude, but unfortunately i need the bubbles to connect to the top shapes so i can populate the top shapes with data from the reference bubble.  This might be an interesting feature request.

Jumpy

#3
Are the shapes 1D and/or 2D? Maybe it's possible to work with in- and outbound CPs?

In one of my templates I use a global Connection event and eventually repent/rebound(?) a unwanted shape. But that uses events and VBA.

MacGyver

The shapes are 2D.

Ideally the reference bubbles would connect to the midpoint of the shapes, where there isn't initially a connection point on the shape.  After the reference bubble connects to the shape however, a connection point gets created.

An example below shows a Network Rack diagram and for the 1U Box (KVM) the midpoint of the KVM doesn't lie directly on top of a Network Rack connection point.  However, for the 2U Box (SVR 1), the midpoint of the SVR 1 lies directly on top of a Network Rack connection point

Jumpy, could you give me a quick example of the repent/rebound commands?  I am rather familiar with programming in vba, but have yet to use these commands nor the global connection event.  I believe this solution might provide an adequate solution.


Paul Herber

Have you considered putting shapes on different pages, then making the page containing you don't want to connect to a background page?
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

wapperdude

Another possibility would be to temporarily move the upper shape from the rack, attach the bubbles to the shape and then place the shape back on the rack.  It would drag the bubble with it.

Visio 2019 Pro

Jumpy

I'm currently out of town and not in reach of my PC. I can send you code examples in the evening when I'm home.
But I don't remember what happens in the code, if a CP is created "on the fly" because you are using "gluing to geometry". So maybe your shapes should have a CP at their midpoint.
That way the CP and the CP of the rack-shape lay above each other. Maybe you can try out which CP get's connected to. Maybe that depends on the Z-order of the shapes? Could be another solution.

What I remember is, that I had to change the row-type of the rows in the Connenctions-Section of the ShapeSheet, so I could use the cells in the "D" Column. I placed a marker there to identify the Connection Point so the code "knows" if this is a valid connection (for the current connector) or not.


MacGyver

thanks all for the responses

Jumpy,
you were right, adding a connection point to the midpoint of the SVR 1 shape solved the problem.  Pretty sure it depends on the Z-Order but that shouldn't be an issue.