Joining Control Point and Connection Point.....

Started by DavidCBzz, May 07, 2019, 03:00:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DavidCBzz

Greetings,

I'm attempting to "connect" an Associated Callout's Control point to one end of a Connector (elbow/NON-dynamic). Its a master shape w/ two parts  a.) CallOut  b.) Connector.

Won't bore anyone w/ my futile attempts of getting the Control point to track with the Connection Point, other than to say I've lost some hair over the past week:-)

I'm at the point were I don't think its possible, and its for a reason, I'm missing something.....but what /where is it ??,

Forgive me if Its the obvious....

I did see this post from 2011 and and it states - "Keeps the Ignorant Ignorant "
http://visguy.com/vgforum/index.php?topic=2829.msg12024#msg12024

I was thinking I should start looking at an automated process (VBA), right click on Shape, menu add,  CallOut-1, CallOut-2, CallOut-3...

Thanks,

Newbie









vojo

You appear to be over analyzing this.

2 options
- in shapesheet, set connection point to control point  x to x   y to y    //explicit control
  (in general, any geometry or control points can control connection point...user, prop, etc don't have a geometry frame of ref)
  (lastly, visio guy did a nice tutorial on constrain a control point user setatref constructs...constraining control point in a circle)
or
- in shapesheet, make sure control point glue is true

BTW, in the connections row, type allows 3 methods to glue (0,1,2).  you can look up details but
basically, if I recall, its lines can glue, shapes can glue, either can glue... experiment as appropriate.
I think officially they are called inward, outward, inoutward...or something like that.

DavidCBzz

OK, I will look at this and experiment as appropriate.

Thanks for pointing me in the right direction....., THANKS for the response :-)

Newbie

DavidCBzz

vojo,

Got it !!,  thanks, I was definitely overthinking it, nice call :-)

Still don't have my head wrapped around how it works exactly, and need to set up the glue part.....but am going trough the recommended tutorial now and expect a few light bulbs to go off... http://www.visguy.com/2018/11/07/constrain-control-handle-to-circle/

Thanks Again

vojo

np

Basically since connector cells and control cells both reference the same shape geometry, using the control point settings makes the connector point line up

Now for the next question.  how would relate control point in 1 shape with a connection point in shape 2? 
(same or different geometry...front face of a tube and back face of a tube...connections at same location on both shape)
(or shape 1 is a big square...shape 2 is a small square...controls are in top left corner...want connection same corner of small shape)
Answer...use loctoloc formulas

<shp 2>!connection.x1 = loctoloc(pnt(<shp1>!controls.row_1,<shp1>!controls.row_1.y),<shp1>!width,<shp2>!width)
<shp 2>!connection.y1 = loctoloc(pnt(<shp1>!controls.row_1,<shp1>!controls.row_1.y),<shp1>!width,<shp2>!width)

This formula relates the 2 shapes geometries so that the relationship can happen.
others include loctopar (local to group)  and partopar (group to group).

Experiment at will.

DavidCBzz

Quote from: vojo on May 09, 2019, 01:51:44 AM

(or shape 1 is a big square...shape 2 is a small square...controls are in top left corner...want connection same corner of small shape)
Answer...use loctoloc formulas

<shp 2>!connection.x1 = loctoloc(pnt(<shp1>!controls.row_1,<shp1>!controls.row_1.y),<shp1>!width,<shp2>!width)
<shp 2>!connection.y1 = loctoloc(pnt(<shp1>!controls.row_1,<shp1>!controls.row_1.y),<shp1>!width,<shp2>!width)

vojo,

So I created 2 squares, SQRB & SQRS, placed code (below) in SQRS Controls Row_1, it accepted the code, and moved the control point, but something isn't right.

=GUARD(Connections.X1=LOCTOLOC(PNT(SQRB!Controls.Row_1,SQRB!Controls.Row_1.Y),SQRB!Width,Width))
=GUARD(Connections.Y1=LOCTOLOC(PNT(SQRB!Controls.Row_1,SQRB!Controls.Row_1.Y),SQRB!Width,Width))

I also tied a few variations, I didn't think the GUARD Exp would hurt..but I'm a bit confused..I attempted putting the code in Row_2, but kept getting errors?

P.S. Still working on lining them up, control point is off a bit for Every line of text the callout receives, but I think I got it, added value of the TEXT height to the Controls formula, still tweaking it though..

Thanks for the lesson :-), much appreciated

Newbie

vojo

Apologies, I lead you astray

In essence, Loctoloc et al does NOT adjust source shape point to local shape...what it really does take srce point and makes
sure it lines up based on local coordinates 
(in other words, as local changes size, loctoloc makes sure it still lands on source point)

To do what I described initially involves more calculation
SRCE shape is the shape that has controls
DEST shape is the local shape you want a point to line up

So in DEST shape
user.dx = pinx - SRCE!pinx
user.dy = piny - SRCE!piny
user.scaleX = SRCE!width/width
user.scaleY = SRCE!height/height

In essence, you manually determined where connection should based on where the shape is (pinx and piny) and size of the shape (width and height).

Then can do
DEST
connection.x1 = guard(loctoloc(pnt(SRCE!controls.row-1*user.scaleX-user.DX,SRCE!controls.row_1.y*user.scaleY-user.dx),SRCE!width,width)

connection.y1 = guard(loctoloc(pnt(SRCE!controls.row-1*user.scaleX-user.DX,SRCE!controls.row_1.y*user.scaleY-user.dx),SRCE!width,width)

I will try to work up and example.

Sorry for confusion (it does suggest a new function visio could add:  Map a shape's point into the local shape framework and take care of the translation and scaling).


DavidCBzz

vojo,

I've attached a file, think I'm getting close.

It looks as if the Control point and Connection Point (Both "X" and "Y") are off track by a distance equal to

(Master Shapes Bottom Left Corner)  - ( Call Outs Bottom Left Corner)

As the Call Out text size changes, the distance between the two remains consistent with the change in Text size, their looks to be a common multiplier.

I've attempted numerous combinations, .....numerous....with no avail :-(

Attached is a sample sheet.....(amateurish) It may help

Thanks in Advance

Newbie

DavidCBzz

So I was finally able to get this to work.

I modified a shape from one of the other threads, I need to refine it a bit, but it works.

I'm still not able to wrap me head around what I was originally doing wrong or missing (second shape) but I'm going to let it go.  I've gotten the original design to work, however I can't get it to link to the target shape, more than likely because l went right to chapter 4, and skipped chapters 1, 2 and 3.

Thank for all the help vojo !

David


vojo


wapperdude

Perhaps I'm missing something or misunderstanding.  Is the objective to move the control point to another shape and have the control point glue to that shape?  If so, there's a cell for the control point in the shapesheet that allows you to enable gluing.  Then, it will glue to the connection point.  Plus, if you enable gluing to a shape, the control point will glue to the shape even if there is no connection point.  When glued, the control point's X and Y cells have the info showing where/what it's glued to.

Wapperdude
Visio 2019 Pro

vojo

to be honest, after the back and forth, I am not sure exact what he is trying to do.

the previous post drawing might clear the fog:  "I understand that but I want to do this"

vojo

I opened your drawing up...same functions as mine

So what exactly do you mean by "link to target shape"   your top and bottom work fine....move the shape with the words,
the connections drag along...adjust the middle connections, both legs move.

maybe a hand drawn before and after (no shapesheet automation) drawing plus some text boxes might clear the fog

DavidCBzz

Hello,

My terminology needs work, :-[

What I'm trying to do is create a call out that works like the Custom Callouts, 1,2 3, but with a few differences.

Would prefer the connector to be dynamic, and the textbox to be a Partial Bracket Callout.



The need is for large building plans, one side of the drawing will have the structure, the other the callout identifying the device, all linked to Excel.



Once Again, please excuse my confusion, and a million thanks !!

David

vojo

ooooohhhhh

1: just add connection points on the shape and callout
2: just use a connector ...attach ends to the desired connection point...move either shape and connector reacts.

I tried what I believe you are stating  (top right of attached)

( a connector is just any old line with the begintrigger cell, glue cell, endtrigger cell = =_XFTRIGGER(EventXFMod)  )

BTW, you can do more interesting things like the blue shape (based June's stuff)  use shape data to play with it.