Downturn of performance (redrawing problem)

N

Nikolay Klinachyov

I have test procedure (see below)
The time of execution of a cycle is increased for each next i

How to deactivate redrawing the document after each ActivePage.Drop?
But I should see the drawing process.


Public Sub test()
drawingDoc = K2.AxDrawingControl1.Document
vsoApp = drawingDoc.Application
stencilDoc = vsoApp.Documents("SimLib.vss")
Dim shpBlock As Visio.Shape
Dim i As Integer

For i = 0 To 200
shpBlock = vsoApp.ActivePage.Drop( _
stencilDoc.Masters("gain"), 0, 0)
shpBlock.CellsSRC(visSectionObject, visRowXFormOut, _
visXFormPinX).Formula = i * 0.125 & "cm"
shpBlock.CellsSRC(visSectionObject, visRowXFormOut, _
visXFormPinY).Formula = i * 0.25 & "cm"
System.Windows.Forms.Application.DoEvents()
Next i
End Sub
 
J

JuneTheSecond

Unfortunately, I think I cannot stop re-drawing, unless otherwise I wish to
watch the process.
 
N

Nikolay Klinachyov

This Visio Drawing Control problem.
The time of performance of a cycle is increased even if to make comments
System.Windows.Forms.Application.DoEvents()

The similar VBA-cycle for the Visio works more quickly.
The decrease of performance is observed but not so dramatically.
Visio does not redraw the all document after each ActivePage.Drop

It is very important to solve this problem.
My drawings of mathematical models can contain 50.. 500 shapes.
Also are completely drawn by script at my command "File open models"
 
N

Nikolay Klinachyov

Thanks. Good idea: EventsEnabled, ShowChanges, ScreenUpdating
But here probably still the reindexing collections problem in visio Cpp-code
is observed ...
 
B

Bill Morein [MSFT]

I would recommend looking at the DropMany method instead of Drop. Using this
will result in significant performance improvements.

--
Bill Morein
Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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