Drop slow

A

Anders

We are dropping a selection from within a VB6 .dll.

The problem we have is that the drop of the selection (approx 100 shapes) on
a new page is taking very long time (approx 10 seconds). Is there a way to
speed things up?

The code:

Set lSel = lSpl.SpatialNeighbors(0, 0, 0)

lX = lLeft + (lRight - lLeft) / 2 + lFrm.CellsU("pinX").ResultIU -
lSpl.Cells ("Pinx").ResultIU + (20 + 5) / 25.4

lY = lBottom + (lTop - lBottom) / 2

lSel.BoundingBox 7, lLeft, lBottom, lRight, lTop

lPagO.Drop lSel, lX, lY
 
A

Anders

:) I already checked that. It cut execution time with 2 seconds

Changed:
Set lSel = lSpl.SpatialNeighbors(3, 0, 0)
to:
Set lSel = lSpl.SpatialNeighbors(0, 0, 0)

But it is the statement:
lPagO.Drop lSel, lX, lY

that takes > 10 seconds.
 
A

Anders

Setting:


Application.ScreenUpdating = False
lPagO.Drop lSel, lX, lY
Application.ScreenUpdating = True

Cut execution time from 10 s to 3,5 s.
 
A

Anders

The screenupdating property had nothing to do with it. It is the DoEvents
done after the Drop that causes the long response time.

We are cutting geometries and shifting endpoints on connectors. Because of
this it seems that we need to ha this:

Application.ScreenUpdating = True
DoEvents
Application.ScreenUpdating = False
 
A

Anders

The problem is this statement:

"Passing integers (master indices) or strings (master names) to DropMany is
faster than passing objects, but integers or strings can identify only
masters in the document stencil of the document onto which it is being
dropped. Hence your program has to somehow get the masters in question into
the document stencil in the first place, provided they weren't there already."
 
A

Al Edlund

For complex drawings, where possible, I always load the masters into the
document stencil first. The flow then becomes

check for master in document.masters
if not there check for stencil being loaded and get it from loaded stencil
if not there then, and only then, load the stencil to get the master.

The other thing I do is try to separate out the dropping/drawing from the
configuring of the shapes. The working with shape data can take longer than
getting the drawing built.

The dropmany hasn't worked for me because I often have to put the shapes
down in a specific order (parent/child).

al
 

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