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

Connector Shape Geometry Question

Started by Scott10284, May 31, 2024, 11:56:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Scott10284

Is there a way to prevent a Connector shape from automatically straightening itself?

At times I would like to position a connector such that there is a very small "step" in the shape geometry and it responds by straightening itself out into a small slope instead. I have tried changing many different properties in the Behavior menu (such as setting the Connector Style to Right Angle), but none of them seem to work.

Is there a way to prevent this shape behavior?

Yacine

#1
Yes, very annoying this behavior and I wouldn't know of a simple solution.
However you can build your own connector.
You basically work with a 1D group shape and have straight lines in it.

P.S. Specially this exasperating fine tuning of connectors has led to be very strict with grids and connection points.
In cases, where I cannot avoid it, I help myself with connection points attached to control points. Very effective.
Yacine

wapperdude

Pretty sure I've seen this before.  But, I've not been able to replicate the problem now.  I tend to concur with Yacine's conclusion.  Can you upload a sample file so something simple isn't overlooked?
Visio 2019 Pro

Yacine

I thought, it would be clever to be lazy ... read my inquiry @ chatGPT. Quite funny.
https://chatgpt.com/share/3726e515-2234-4b67-a0c3-abef7453ca3e
Yacine

wapperdude

 ;D   Surprised it didn't ask..."Who's Yacine?"  That would have been hilarious.

Just to be clear, my post was about the original post, not Yacine's 1st reply.  Think I'll go ask chatAI why 2 + 2 =4?
Visio 2019 Pro

Yacine

#5
Here's a solution that combines simplicity with a bit of complexity. Let me explain.

First, let's tackle the basic idea. You can convert the connector to a group and place two lines within it.

1. Line 1 starts at coordinates (0,0) (the local coordinates of the connector's beginning) and ends at the width of the parent with y=0, forming a perfect horizontal line.
2. Line 2 mirrors this setup.

This works well when the connector's dx and dy are calculated. However, there's a caveat: these formulas get replaced by a fixed value below a certain threshold, which in my case is 5mm. The threshold may vary for an "imperial" installation.

I tried to identify this 5mm parameter within the pagesheet but found nothing concrete. Essentially, you'll get an offset in either or both directions.

Not fully understanding how this offset works, I resorted to brute force. It seems related to dx, dy, locpinX, and locpinY. I used these in the Begin/End of X/Y and tweaked the factors until arriving at the following formulas:

Line 1
- BeginX = (Sheet.1!EndX - Sheet.1!BeginX) * -0.5 + Sheet.1!LocPinX * 1
- EndX = (Sheet.1!EndX - Sheet.1!BeginX) * 0.5 + Sheet.1!LocPinX * 1
- BeginY = (Sheet.1!EndY - Sheet.1!BeginY) * -0.5 + Sheet.1!LocPinY * 1
- EndY = (Sheet.1!EndY - Sheet.1!BeginY) * -0.5 + Sheet.1!LocPinY * 1

Line 2
- BeginX = (Sheet.1!EndX - Sheet.1!BeginX) * 0.5 + Sheet.1!LocPinX * 1
- EndX = (Sheet.1!EndX - Sheet.1!BeginX) * 0.5 + Sheet.1!LocPinX * 1
- BeginY = (Sheet.1!EndY - Sheet.1!BeginY) * -0.5 + Sheet.1!LocPinY * 1
- EndY = (Sheet.1!EndY - Sheet.1!BeginY) * 0.5 + Sheet.1!LocPinY * 1

These formulas ensure the two lines follow the desired points.

Switching Modes
The neat part is that this setup allows you to switch between a regular connector and an "almost" straight version. I used a formula in the parent shape to calculate dx and dy, and if they are small enough, the connector switches to the other mode.

Since the 5mm threshold is somewhat arbitrary, I added a custom property so you can set this value yourself. The visibility of either the main connector or the two subshapes toggles exclusively based on this threshold.

This method keeps the connector fully functional while providing the flexibility to switch between different behaviors.

Regards,
Yacine
Yacine

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: 251 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1092KB.
Tokens: post-login.
Cache hits: 14: 0.00136s for 26,766 bytes (show)
Cache misses: 3: (show)
Queries used: 15.

[Show Queries]