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

Connection Points / Connectors - Resizing with shape/group....

Started by Brandy, June 03, 2010, 04:52:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jumpy

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.


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

@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

@Jumpy

I received this error (new code/script)

Thanks

Brandy

Brandy

@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

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

Brandy

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

@Jumpy

It didn't like the:

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

Brandy

@Jumpy

Why did you specify a color in the code?... now everything turns "Red"...

Thanks Brandy

Jumpy

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

@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


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: 298 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1155KB.
Tokens: post-login.
Cache hits: 14: 0.00173s for 26,721 bytes (show)
Cache misses: 4: (show)
Queries used: 16.

[Show Queries]