OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 28-05-2012, 16:07
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default Create Symbols at Speed

Hi
Im trying to create about a million instances of the same symbol. Im currently doing this in batches of 50,000 and its not fast and would like to ask what might be the fastest method.
Im using a macro that reads a line from an Excel workbook and then pastes the clipboard according to the 4 items of data - x,y position, size and rotation.

I have had a look at VirtualShapes and Creating Instances of Symbols and Im happy to work on the details but would like some guidance as to what the right approach would be to make it as fast as possible.

thanks
nic
Reply With Quote
  #2  
Old 29-05-2012, 08:35
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

My first question would be, what version of Draw are you using? X6 has seen vast improvements in speed and reliability on Win7 64bit. Other versions, especially X5, run really slow.

Another question would be, why 1 million copies? Sounds like over kill.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #3  
Old 29-05-2012, 21:25
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default

Quote:
Originally Posted by ddonnahoe View Post
My first question would be, what version of Draw are you using? X6 has seen vast improvements in speed and reliability on Win7 64bit. Other versions, especially X5, run really slow.

Another question would be, why 1 million copies? Sounds like over kill.
A. X6 and yes a million is a big number - they are patterns formed by data and in this instance the bigger the better. By using circles I have managed to plot 842000 (created in 4 files and then merged) but now Im trying the same thing with symbols and it seems slower but this may be because Im now including a rotation in the symbol.

Here's the loop im using (having copied the symbol to the clipboard)
Code:
For n = ro1st To roFin        ' for each line in the spreadsheet 

                              ' read in values
x = XL.Cells(n, 5).Value
y = XL.Cells(n, 6).Value
sz = XL.Cells(n, 8).Value
Ro = XL.Cells(n, 7).Value


sclip.SetPosition x, y        'set its position
sclip.setsize , sz	      'Sized proportionaly by height (sz ,   for by width) 
sclip.Rotate Ro               'rotate it


Next n
Reply With Quote
  #4  
Old 01-06-2012, 12:12
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Speed

A couple of suggestions, first do not copy / paste to the clipboard, this is really really and let me toss in one more really slow.

Second, have you turned on Optimization?

Third, I will need to play with all your code to really did in and Optimize it for speed.

-Shelby
Reply With Quote
  #5  
Old 03-06-2012, 09:19
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default

Hi Shelby

Thanks for the reply.

You have told me before that cut and paste is slow and I really have heeded your advice when I knew how, here I was a little stuck and since the original post the macro has developed a little (and I dropped the cut and paste). I have attached the current version and a short example spreadsheet. I need to find out how to use external Symbol libraries and dont use them because cant see how to edit them afterwards.

If you would comment on speeding it up I would be grateful - it seems that as the file size grows, the creation of new symbols slows up - so that creating 200,000 symbols takes about 4 times as long as 100,000.

Thanks
nic
Attached Files
File Type: zip fast_symbol.zip (22.1 KB, 363 views)

Last edited by nic; 03-06-2012 at 09:21.
Reply With Quote
  #6  
Old 18-06-2012, 11:54
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Symbols

I took a look at this, and the slowest part is the creation of the symbol, however as you have stated they are not supported via the Virtual Layer or VirtualShapes, so I am not sure how much of an improvement you will be able to get.

If I get a little more time, I will try and be a little more creative. ;-) You never know what they might generate.

-Shelby
Reply With Quote
Reply

Tags
optimization


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual layers, shapes and drawing speed jemmyell CorelDRAW/Corel DESIGNER VBA 2 06-05-2009 16:40
Speed-up processing 10 times :-) wOxxOm CorelDRAW/Corel DESIGNER VBA 2 12-03-2008 03:17
How to increase redraw speed 100 times wOxxOm Feature requests/wishlist 1 05-05-2006 21:17
Speed up printing RonHill General 0 22-06-2004 14:20
speed difference between corelscript and vba bbolte CorelDRAW CS 2 05-12-2002 18:58


All times are GMT -5. The time now is 12:42.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com