Author Topic: Connector goes to center of shape instead of edge  (Read 322 times)

0 Members and 1 Guest are viewing this topic.

zohassadar

  • Newbie
  • *
  • Posts: 3
Connector goes to center of shape instead of edge
« on: April 24, 2020, 05:27:41 PM »
I have a confounding problem that I'm hoping someone can tell me what might be happening.  I have a grouped shape called "Box" and when a connector lands on it, the connector lands somewhere on the edge.  This is the desired behavior.  However when certain shapes are added to the group, the behavior changes and the connector goes right to the center. I noticed that it only acted this way when I was using another grouped that included a small shape of a phone.  I ungrouped and narrowed it down to this one shape, but can't find anything in the shapesheet that differentiates it from any other shape where this behavior doesn't happen. 

Does anyone have anywhere they can point me to?  I'd like to change whatever property or setting of the phone shape so that when it's grouped to the box, connectors land on it normally. 


vojo

  • Hero Member
  • *****
  • Posts: 1419
Re: Connector goes to center of shape instead of edge
« Reply #1 on: April 25, 2020, 04:43:36 PM »
its up to you, but the simple answer is to put a connection point on the edge of the shape.

for example, lets say you have 2 rectangles  (left one is sheet.001....right one is sheet.002)
- for connection point on right edge in middle for left one
- sheet.001 (and lets say you want to name the right connection point "r")
    - right click shape and go into shape sheet (need to turn on developer mode...bottom of advanced options)
    - may need to add a section called connections and in label cell = r
    - connections.r.x = width*1
    - connections.r.y = height*0.5
-sheet.002 (and lets ay you want to name the left connection point "l")
    - right click shape and go into shapesheet
    - ditto about adding a connections section...connections label cell = l
    - connections.l.x = width *0
    - connections.l.y = height*0.5
You need have explicit / discrete connection points you can attach to


wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3746
  • Ideas Visio-lized into solutions
Re: Connector goes to center of shape instead of edge
« Reply #2 on: April 25, 2020, 07:35:25 PM »
Another technique would be to select the subshape and open its shapesheet.  Scroll to Misc. Section.  Set the Obj Type = 4.  That ought to restore the behavior you desire.
Visio 2019 Pro

zohassadar

  • Newbie
  • *
  • Posts: 3
Re: Connector goes to center of shape instead of edge
« Reply #3 on: April 26, 2020, 11:04:48 AM »
vojo, thanks for the suggestion, that's a solid solution.  I do have connection points already defined that are used for sprucing up the layout.  In some cases when boxes are next to one another with a single connection between them, the connector behavior landing at the edge instead of the center saves the steps of moving each end to a connection point.  I'm on a mission of as much automation as possible  :D

wapperdude, I believe I have tried several combinations of ObjTypes, but am willing to work with any suggestion, so I did just that.  Nothing changed.  To make my question better asked, here's an example of what I'm working with. 

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3746
  • Ideas Visio-lized into solutions
Re: Connector goes to center of shape instead of edge
« Reply #4 on: April 26, 2020, 04:26:29 PM »
The issue is definitely the phone shape.  Couldn't find anything in the shapesheet.

Decided to re-create the shape.  One slight difference is that mine is a grouped shape.  I don't think that actually matters.  I was just lazy.
What might be significant is how the body portion of the phone was created.  On the main body shape, I overlayed the 9 button shapes and the screen shape.  Note, all of these, including the main shape had their corner roundings preset.  Then I used the operation combine.  The difference is that your original shape had a lot of NurbsTo geometry row types, whereas, my construct resulted in EllipticalArcTo row type.  Visio might not like the NurbsTo.

Anyway, I added it to the test group and all  works as expected.

Wapperdude.
« Last Edit: April 26, 2020, 04:38:17 PM by wapperdude »
Visio 2019 Pro

zohassadar

  • Newbie
  • *
  • Posts: 3
Re: Connector goes to center of shape instead of edge
« Reply #5 on: April 27, 2020, 12:46:17 PM »
I had noticed all the NurbsTo rows, then looked up what Nurbs means and realized there's no chance of me understanding what's happening there. I also figured as these formulas are describing where points are, it wouldn't affect the behavior of how the connector wants to land on the outer shape.  However I read your response and played with the shape a little more and started deleting geometry sections to see if I could get whatever remains to behave differently.  Deleting the top sections until there are 6 sections remaining, the behavior remains the same, deleting one more causes the shape to behave as I would expect any other shape to behave.  Deleting from the bottom up, when sections 9-12 are gone, the same behavior, when section 8 is also removed, it changes.  Basically the conclusion I'm arriving at here is that it doesn't matter that there are NurbsTo rows in the Geometry sections, but rather the quantity of them. 

For some background on what I'm working on, I have been automating network diagrams for a few years now.  I like the style of a the icon representing the network device in a box, with text fields displaying the trivia.  A previous iteration of this automation used a single box (already a group) with the text fields set up and only needing variables to be set and using powershell, lay out the box, lay out the icon then add the icon to the group.  Connections would be made and then the result would require a little bit of layout but overall saving a ton of time.  During that time, the shapes I had representing the voice gateway and the UPS caused the weird behavior.  I tried figuring it out then but always came to a loss and just accepted that those icons behaved differently. 

I'm on another iteration, rather than keeping the network icons separate and grouping them, I've found a way to put together all the icons associated with the box and by selecting an option in a right-click menu, the icon you want to see is the visible one.  I use a bit of powershell to assemble this all for me.  I'm also using an entirely different set of icons.  At this point I have no idea which shape (or shapes) are causing the undesirable connector behavior because their all grouped together (to be able to post something here I went back to the old set).  I think in order to pursue a solution as you did, rebuilding the offending shape, I'd have to figure out some automated way to test the behavior of each shape (and each shape's subshapes).  I was hoping that someone here might point out that I missed the "xyz" checkbox and that after toggling, all my problems would then be solved.  I'd then apply whatever that fix was to the powershell script I'm using and apply that to everything. 


Thank you for the response!