Author Topic: Restrict glue settings for a shape  (Read 5269 times)

0 Members and 1 Guest are viewing this topic.

MacGyver

  • Full Member
  • ***
  • Posts: 85
Restrict glue settings for a shape
« on: September 10, 2012, 06:52:42 PM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3833
  • Ideas Visio-lized into solutions
Re: Restrict glue settings for a shape
« Reply #1 on: September 10, 2012, 11:42:48 PM »
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

  • Full Member
  • ***
  • Posts: 85
Re: Restrict glue settings for a shape
« Reply #2 on: September 11, 2012, 09:39:27 AM »
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

  • Hero Member
  • *****
  • Posts: 1061
Re: Restrict glue settings for a shape
« Reply #3 on: September 11, 2012, 10:02:53 AM »
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.
« Last Edit: September 11, 2012, 10:05:43 AM by Jumpy »

MacGyver

  • Full Member
  • ***
  • Posts: 85
Re: Restrict glue settings for a shape
« Reply #4 on: September 11, 2012, 11:53:25 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2955
    • Paul Herber's website
Re: Restrict glue settings for a shape
« Reply #5 on: September 11, 2012, 12:57:50 PM »
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 and applications for Visio -

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

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3833
  • Ideas Visio-lized into solutions
Re: Restrict glue settings for a shape
« Reply #6 on: September 11, 2012, 02:31:25 PM »
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

  • Hero Member
  • *****
  • Posts: 1061
Re: Restrict glue settings for a shape
« Reply #7 on: September 12, 2012, 01:51:31 AM »
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

  • Full Member
  • ***
  • Posts: 85
Re: Restrict glue settings for a shape
« Reply #8 on: September 12, 2012, 01:29:35 PM »
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.