Visio Guy

Visio Discussions => Programming & Code => Topic started by: PinPinPoola on September 03, 2021, 03:37:22 PM

Title: VBA - Cleanest way to drop new shape and then update it's 1-D endpoints.
Post by: PinPinPoola on September 03, 2021, 03:37:22 PM
Hello,

I am using the Shape.Drop method to place a new shape on the bottom of the page and then I am updating it's 1-D endpoints, to connect it to an existing shape, by changing the 4 Shape.Cells properties:

vsoShape.Cells("BeginX").FormulaU =
vsoShape.Cells("BeginY").FormulaU =
vsoShape.Cells("EndX").FormulaU =
vsoShape.Cells("EndY").FormulaU =

This is working, except as each of the 1-D endpoints is updated, the shape is stretched across the page for a fraction of a second and it looks weird.

Is there a way to update all 4 of the 1-D endpoints at once or to hide the dropped shape, change all 4 endpoints and then unhide the shape?

As always any help/pointers will be greatly appreciated.

Thx
Pin.
Title: Re: VBA - Cleanest way to drop new shape and then update it's 1-D endpoints.
Post by: Surrogate on September 03, 2021, 04:00:20 PM
Hi, Pin!

What kind of 1-d shape do you mean: dynamic connector?
Title: Re: VBA - Cleanest way to drop new shape and then update it's 1-D endpoints.
Post by: PinPinPoola on September 03, 2021, 04:52:01 PM
Hello Surrogate. :D

I am linking server I/O card and HDD shapes to server chassis shapes.

I am dropping lots of these 'sub-shapes' on to server shapes and the stretching / moving steps around actually makes me feel slightly ill with the motion.

The 6 'steps' take approx 1-2 seconds to complete. See the attached 2 pdf's (the 2nd will be on a second post due to the 500Kb restrictions).

Thx.
Pin.


Title: Re: VBA - Cleanest way to drop new shape and then update it's 1-D endpoints.
Post by: PinPinPoola on September 03, 2021, 04:52:57 PM
Additional steps 4-6 in PDF attached.
Title: Re: VBA - Cleanest way to drop new shape and then update it's 1-D endpoints.
Post by: wapperdude on September 03, 2021, 06:06:08 PM
Check out glueto method:  https://docs.microsoft.com/en-us/office/vba/api/visio.cell.glueto (https://docs.microsoft.com/en-us/office/vba/api/visio.cell.glueto)

There are many topics in forum wrt glueto. 
Title: Re: VBA - Cleanest way to drop new shape and then update it's 1-D endpoints.
Post by: PinPinPoola on September 03, 2021, 08:48:07 PM
Thank you @wapperdude.

Will do. Have a great weekend!

Pin