Connection Points

M

Mishaev Mark

Hi all,

I'm building an application in which the shapes may have many connection
points.
My task is to automatically create dymamic connectors between the shapes
that are on the drawing and shapes which are being dropped on the page.

My question is: how can I know to which connection point the being dropped
shapes is glued?


Thanks,
Mark.
 
A

Al Edlund

since you (as the developer) are dropping the shapes, in what order are you
dropping them (first shape and then connectors, or connectors and then
shapes. Once you drop a shape (as a developer you should know what
connection points are available on the shape) you probably should then drop
the connector and assign the ends to the appropriate shapes and connection
points. It's dangerous to assume that a connector will search out the
correct point every time.
al
 
A

Anders Christensen

Maybe this little example will help you

'vsShape is the connector
'fromShape is the shape the connector goes from
'toShape is the shape the connector goes to

Dim vsCell1 As Visio.Cell = vsShape.Cells("BeginX")

Dim vsCell2 As Visio.Cell = fromShape.CellsSRC(7, 21, 0) 'second parameter
is the connectionpoint on fromShape

vsCell1.GlueTo(vsCell2)

Dim vsCell3 As Visio.Cell = vsShape.Cells("EndX")

Dim vsCell4 As Visio.Cell = toShape.CellsSRC(7, 8, 0) 'second parameter is
the connectionpoint on toShape

vsCell3.GlueTo(vsCell4)
 
B

Ben Donley

Thanks. Perfect. I've been reading documentation (if only for a half
hour) and everything seemed to be avoiding this plain description.

Is there a similarly easy way to make the glue walk (_WALKGLUE or
whatever)? My understanding of the "Visio 2003 Developer's Survival
Pack" is very much avoiding the subject.
 
B

Ben Donley

I answered my own question. Use ".CellsSRC(1,1,0)" rather than
".Cells(7,x,0)" and it'll choose the right connection point for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top