Author Topic: Visio Development Top Five Performance Tips  (Read 162 times)

0 Members and 1 Guest are viewing this topic.

Visisthebest

  • Full Member
  • ***
  • Posts: 128
Visio Development Top Five Performance Tips
« on: June 29, 2020, 08:44:25 AM »
These 5 performance tips for programming Visio with .NET I understand how the first 4 work but not the 5th:

https://surrogate-tm.github.io/mailant/2004/09/22/dev-luv-visio-development-top-five-performance-tips.htm

“5. Drop all shapes first to any random location: It is faster to drop all your shapes in a random location on a page and then reposition them as needed.”

I don’t understand how this is faster than dropping them in the correct position right away.

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2892
    • Paul Herber's website
Re: Visio Development Top Five Performance Tips
« Reply #1 on: June 29, 2020, 08:48:30 AM »
One drop of n shapes followed by setting the X and Y locations of those n shapes is quicker than doing n drops. For 5 shape drops you might not be bothered but for hundreds ...

Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

Visisthebest

  • Full Member
  • ***
  • Posts: 128
Re: Visio Development Top Five Performance Tips
« Reply #2 on: June 29, 2020, 09:36:44 AM »
Wow really surprising I would have guessed dropping then setting the correct shape positions to be a lot slower. Wondering why this is, may give some insight in to how the Visio engine works internally.

I guess setting ShowChanges to False:
https://docs.microsoft.com/en-us/office/vba/api/visio.application.showchanges

While dropping hundreds of shapes can also help speed things up.