Author Topic: Connection Points / Connectors - Resizing with shape/group....  (Read 46327 times)

0 Members and 1 Guest are viewing this topic.

Jumpy

  • Hero Member
  • *****
  • Posts: 1061
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #45 on: June 08, 2010, 07:04:14 AM »
Hello again Brandy,
you seem to like my scripts so I give you another one. It contains the Sub Con_search_start.
It will highlight every Connector that has an end that is not connected and every Connector that is connected dynamically (Walkglue).
That will be the most offending connectors when resizing and I would recommend to connect them manually to a nearby connectionpoint.

Afterward you can run the Second Sub, named Undo_start to remove the highlighting.

When this is done, the connectors will almost certainly still not resize correctly, but should at least maintain their connections.
Reason for the behaviour is the automatic layout and routing. Code behind the scenes, that like wapperdude said, is not controllable.

Code
Sub Con_search_start()
Dim shp As Visio.Shape

For Each shp In ActivePage.Shapes
Con_search shp
Next
End Sub

Sub Con_search(ByRef shp As Visio.Shape)
Dim SubShape As Visio.Shape
Dim mark As Boolean
mark = False

If shp.OneD Then
 If InStr(1, shp.Cells("BeginX").Formula, "WALKGLUE") > 0 Then mark = True
 If InStr(1, shp.Cells("EndX").Formula, "WALKGLUE") > 0 Then mark = True
 If InStr(1, shp.Cells("BeginX").FormulaU, "PNT") < 1 Then mark = True
 If InStr(1, shp.Cells("EndX").FormulaU, "PNT") < 1 Then mark = True
End If

If mark = True Then
shp.Cells("LineColor").Formula = 2
shp.Cells("LineWeight").Result("pt.") = 3
End If

For Each SubShape In shp.Shapes
 Con_search SubShape
Next

End Sub

Sub Undo_start()
Dim shp As Visio.Shape

For Each shp In ActivePage.Shapes
Undo_Line shp
Next

End Sub

Sub Undo_Line(shp As Visio.Shape)
Dim SubShape As Visio.Shape

If shp.OneD Then
 If shp.Cells("LineColor").Result("") = 2 And shp.Cells("LineWeight").Result("pt.") = 3 Then
  shp.Cells("LineColor").Formula = 0
  shp.Cells("LineWeight").Result("pt.") = 0.24
 End If
End If


For Each SubShape In shp.Shapes
 Undo_Line SubShape
Next

End Sub


Brandy

  • Full Member
  • ***
  • Posts: 91
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #46 on: June 08, 2010, 10:03:40 AM »
@Jumpy

You are so, so sweet.....

Thank you so much... absolutely magnificent...



My biggest problem was not losing connection, but resizing with the diagram... Due to the enormous number of shapes embedded in each diagram the lines goes around, across, under, over, etc...  On that note, I have to take time to re-structure the lines and that's a very, very, very tedious process.  There are at least 150 to 200 lines/connectors in one diagram… That’s a lot of re-work..

There’s nothing compare to what you have done for me…. so, stop whining Brandy and just do it… ???

Thanks for being so wonderful.... :-*

Brandy

Brandy

  • Full Member
  • ***
  • Posts: 91
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #47 on: June 08, 2010, 11:07:29 AM »
@Jumpy

I received this error (new code/script)

Thanks

Brandy

Brandy

  • Full Member
  • ***
  • Posts: 91
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #48 on: June 08, 2010, 02:21:53 PM »
@Wapperdude

I love the 4x larger solution...  and thank you....

I only have one, no two, no three problems...  :D :D :D

1.  I can't zoom in (highest is 68%)
2.  When I try to reset it back to 1x, my lines go into outer space....  I can't reset "Callouts"
3.  My diagrams print extremely small....

Other than that, I'm good.... :)

Jumpy

  • Hero Member
  • *****
  • Posts: 1061
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #49 on: June 08, 2010, 02:46:02 PM »
Don't know whats wrong. Worked fine for me.
U could change the ....Formula = 2 to ...FormulaU = 2
It may be, that some of the lines are guarded. Same for ResultU, which can be used instead of Result.

Like you said, you have many connectors, but not all connectors are badly connected. My script shall help in so far, as to show the (hopefully few) lines, that are badly connected.

In your example have been only black connectors, but in your .png's for wapperdude, there are some mysterious blue, green, red (dotted) lines, too.
It may be, that those are the one's the code is not working with.
If so, the code must be altered, to include a test, if a certain line is one of those, and in that case to ignore that line...

Jumpy
« Last Edit: June 08, 2010, 02:48:17 PM by Jumpy »

Brandy

  • Full Member
  • ***
  • Posts: 91
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #50 on: June 08, 2010, 03:17:25 PM »
I don't believe all are connectors... some are Callouts.

It will not allow me to change the size of the Height on the callouts...

I compared the ShapeSheet original to the outer space one and I can't find anything different.

Sorry about the colors... there are multiple colors within the diagram.  I just noticed that my lines are all "Red"... Crazy.... just crazy... :D :D :D... too funny  :)

Brandy

Brandy

  • Full Member
  • ***
  • Posts: 91
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #51 on: June 08, 2010, 03:59:54 PM »
@Jumpy

It didn't like the:

U could change the ....Formula = 2 to ...FormulaU = 2

Brandy

  • Full Member
  • ***
  • Posts: 91
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #52 on: June 09, 2010, 09:33:00 AM »
@Jumpy

Why did you specify a color in the code?… now everything turns “Red”…

Thanks Brandy

Jumpy

  • Hero Member
  • *****
  • Posts: 1061
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #53 on: June 09, 2010, 03:28:50 PM »
Hi Brandy,
because of your example .vsd (resizedrawin4 ???) I thought all connectors were black, so changing the offending ones to red would make them stand out and so easy to identify. That doesn't make sense anymore, now that I know, that you have connectors in many colors.

So maybe you delete the line with the linecolor and use only the effect of making the lineweight bigger, to identify "bad" connectors.
Although I have to admit that that will only work, if your connectors have all the same lineweight. If they have different lineweights, like they have different colors, it will not help anymore.


Brandy

  • Full Member
  • ***
  • Posts: 91
Re: Connection Points / Connectors - Resizing with shape/group....
« Reply #54 on: June 09, 2010, 03:37:20 PM »
@Jumpy

 ;DYou are so sweetie...

I understand how you feel.. Unfortunately, I didn't create all the diagrams... I created all the stencils/shapes, and some people/engineers have the tendency to do whatever they want even when we set standards.  I'm always changing lines to the correct weight.... or fonts 3x the size of their head....  ::)

Thanks for the clarification.

Brandy