Author Topic: Dynamic Connectors smal blue handles  (Read 15246 times)

0 Members and 1 Guest are viewing this topic.

novski

  • Full Member
  • ***
  • Posts: 182
Dynamic Connectors smal blue handles
« on: August 30, 2014, 06:22:45 AM »
Hi
I have an other Question regarding the Handles of a Dynamic connector.
My Connector has 7 Points i can grab it. But some times these go away after dropping it to narrow connections.
Is it possible to control that in any way?
Thanks
Novski

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3828
  • Ideas Visio-lized into solutions
Re: Dynamic Connectors smal blue handles
« Reply #1 on: August 30, 2014, 03:23:49 PM »
Do you have an example you'd be willing to upload?

Wapperdude
Visio 2019 Pro

novski

  • Full Member
  • ***
  • Posts: 182
Re: Dynamic Connectors smal blue handles
« Reply #2 on: September 02, 2014, 11:38:40 AM »
Hi Wapperdude
Yes i have. But i don't think it will help. If you hook it in between two connection points you can pull one of the blue handles on a line and it will generate 3 new points. The Points in edges are accessible through the command Geometry.X1,2,3,4 but the ones in between i can't access through code...

I wold like to know if its possible to get those points relative to x/y axis...

Thanks a lot!
Novski

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3828
  • Ideas Visio-lized into solutions
Re: Dynamic Connectors smal blue handles
« Reply #3 on: September 02, 2014, 12:06:51 PM »
I may be wrong, but, in general, the dynamic connector has a lot of code behind it, so what you see now, may or may not be there if you make any adjustments by moving a connected shape or dropping a shape that forces a re-route.

Those "control" points, Visio adds whenever it adds a new segment to the connector, typically, to change the direction.  Once that's happened, it ought to be possible to use code to go thru the geometry section and move that control point.  But, you'd need to determine which is the correct control point, and then move it.  The location does seem to be relative to the start location, i.e., BeginX, BeginY.

I think it would be difficult to do a reliable search of a specific control handle as both the number of handles and their position is dynamic and not really predictable. 

Perhaps someone else will weigh in with better insight.

Wapperdude.
Visio 2019 Pro

novski

  • Full Member
  • ***
  • Posts: 182
Re: Dynamic Connectors smal blue handles
« Reply #4 on: September 02, 2014, 02:44:33 PM »
Well, is it possible to count the total number of Geometry.X(1,2,3,4,n) that are in that Connector?
Actually the number the connector is changeing the direction...
best regards

vojo

  • Hero Member
  • *****
  • Posts: 1521
Re: Dynamic Connectors smal blue handles
« Reply #5 on: September 02, 2014, 03:38:09 PM »
I dont think dynamic connectors HAVE to have code behind them....June's stuff and the stuff I built off of June's has no VBA involved to handle the yellow (yes still on visio 2003) control points to move segments/legs and recalcuate bends of the overall connector.

Back when the earth was cooling and Visio 2003 was prevalent, there were issues about what showed up in a congested drawing.
Maybe this is another artifact of that.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Dynamic Connectors smal blue handles
« Reply #6 on: September 02, 2014, 08:07:48 PM »
Did you call me?
First time I examined the control points on dynamic connector.
When I changed the data x,y in Geometry1, control points moved.

But dynamic connecor is myterious.
Nothing can I do more.
 
Best Regards,

Junichi Yoda
http://june.minibird.jp/

novski

  • Full Member
  • ***
  • Posts: 182
Re: Dynamic Connectors smal blue handles
« Reply #7 on: September 03, 2014, 09:50:41 AM »
Im asking for a Funktion that counts the existing total amount of Geometry. Rows.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Dynamic Connectors smal blue handles
« Reply #8 on: September 03, 2014, 02:53:29 PM »
I cannot remember it in shape sheet functions.
But in VBA visio has shape.rowcount property.
I am now on iphone, please check online document in msdn.
« Last Edit: September 03, 2014, 03:27:55 PM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

daihashi

  • Full Member
  • ***
  • Posts: 134
Re: Dynamic Connectors smal blue handles
« Reply #9 on: September 03, 2014, 04:16:43 PM »
Unfortunately I don't think there is a way to count in the shapesheet. I do what I call as reverse counting; where the rows report that they exist and update a user defined cell that I have created (specific to the section that I want to count) with the current value + 1.

If there is a built in function then I would definitely be curious to know what it is. However, if I recall correctly... I think that visio guy has an article that addresses a similar type of work around for counting in the shapesheet.

daihashi

  • Full Member
  • ***
  • Posts: 134
Re: Dynamic Connectors smal blue handles
« Reply #10 on: September 03, 2014, 07:40:42 PM »
Actually, it turns out the post I was thinking about was not for this purpose... however it also turns out that Visio Guy did indeed post a different Article that I did not know about for doing exactly what you are asking for in this post.

My method is quite a bit different, but to be honest... the method that he posts in this article is much more direct than what I've been doing. Check it out at the hyperlink below:

http://www.visguy.com/2006/10/04/counting-geometry-sections/

Jumpy

  • Hero Member
  • *****
  • Posts: 1061
Re: Dynamic Connectors smal blue handles
« Reply #11 on: September 04, 2014, 01:48:47 AM »
I would have thought that the formula in the link can't work with a dynamic connector because after you move the connector Visio deletes geometry rows or adds new one and the reference is broken. The Iserr function should capture that the first time, for example after row 6 is deleted. But when row 6 is added again, the connection is still broken and it will not be counted (my guess).
So even VisioGuys suggestion to use Dependson may not work. But maybe it would work to set the formula new every time:

User.SetFormula
=Dependson(...)+SETF(GetRef(User.RowCount),"=ABS(...)+ABS(...)+ABS(...)+...")

daihashi

  • Full Member
  • ***
  • Posts: 134
Re: Dynamic Connectors smal blue handles
« Reply #12 on: September 04, 2014, 06:34:56 PM »
it does, and I can't comment on VisioGuy's method.. but I can tell you a work around I've discovered for the issue that you described.

Originally I tried to use "GUARD" and a number of other functions in the geometry section of the connectors in my master shapes; only to discover that they were instantly removed by Visio. This was frustrating to say the least. However, I then tried setting the formula for the connector geometry section via VBA upon drop. I was very happily surprised to discover that doing it this way allowed me to use "GUARD" within the geometry section, and it would not be over ridden by Visio.

For me this works perfectly, because my templates are heavily automated. I do not even allow Visio to move, or lengthen the connectors... instead I have a number of my own formulas embedded within the shapesheet and pagesheet that defines that behavior. I have many reasons for doing this, which I won't go into here. However, the point is that I think you can "bypass" the natural behavior of the geometry section of the shapesheet by simply using VBA to apply the formula instead of trying to manually set it in the shapesheet yourself.

The only downside to this my method is that if you want to be able to manipulate the connector, then you will need to define some formulas that will allow for the X/Y coordinates to still be manipulated

Another way counting could be done without having to deal with the messy method I describe above is to use the scratch or user section to count the number of rows for you. I've included an excerpt from one of my documents to give an example. It's not exactly the same, but this could be modified to increase the count for each row that actually exists... instead of simply reporting a 1 or a 0 like I have set in my code.

If you want to know specifically why I did this, or why I need it in my document... then i'll be happy to elaborate, but I think that a person can see how a similar idea could be used for the purpose of counting. The only downside to this method is that it requires that you know how many rows, and their locations, that you want to validate if they exist/are in use or not.

« Last Edit: September 04, 2014, 06:36:29 PM by daihashi »

daihashi

  • Full Member
  • ***
  • Posts: 134
Re: Dynamic Connectors smal blue handles
« Reply #13 on: September 04, 2014, 06:39:04 PM »
But maybe it would work to set the formula new every time:
User.SetFormula
=Dependson(...)+SETF(GetRef(User.RowCount),"=ABS(...)+ABS(...)+ABS(...)+...")

I have no idea how I missed this part of your post.

I believe that would work just fine. I think the Geometry section just does not like to be directly edited by a user, but will take setting a formula via VBA... and probably would work also using SETF

novski

  • Full Member
  • ***
  • Posts: 182
Re: Dynamic Connectors smal blue handles
« Reply #14 on: September 11, 2014, 01:39:14 AM »
Hi
I just found time to come back to this post. Thanks for your thaughts about counting the rows in geometry section.
I just can't realy follow what i have to fill in the "(...)" playces of Jumpys sugetion:
User.SetFormula
=Dependson(...)+SETF(GetRef(User.RowCount),"=ABS(...)+ABS(...)+ABS(...)+...")

The ABS(...) cold be the start of Visio Guys/David Parkers post where they use this part:
ABS(NOT(ISERR(INT((INDEX(0,”Geometry1.x1″))))))

But i can't follow the Dependson(...) part...

best regards
novski