![]() |
#1
|
|||
|
|||
![]()
I have a 500mm square page which has about 1000 circles drawn, which will be cut out by a laser cutter to give a template with 1000 (non touching) holes.
The circles were created in a random order and the laser cutter is charged on a time basis so I would like to reorder the circles so as not to waste time with the cutting head going backwards and forwards to cut the next hole. This is the code as it stands but I get an error on running it - unexpected error while executing method coVGshape:: OrderToBack any help? Code:
Sub neworder() Dim x As Double, y As Double, Rd As Double ' x,y co ordinates and radius of area to be checked Dim myselection As Shape ' shapes found in selected area ActiveDocument.Unit = cdrMillimeter 'Set Corel to work in Millimeters ActiveDocument.ReferencePoint = cdrCenter Set myselection = Nothing Rd = 22 ' radius of area to be selected Optimization = True ' turn off updating the screen etc. For y = 1 To 500 Step 10 For x = 1 To 500 Step 10 Set myselection = ActivePage.SelectShapesFromRectangle(x - Rd, y - Rd, x + Rd, y + Rd, False) If Not myselection Is Nothing Then myselection.OrderToBack Next x Next y Optimization = False ' turn on updating the screen etc. ActiveWindow.Refresh End Sub |
#2
|
||||
|
||||
![]()
Hi.
SelectShapesFromRectangle return a cdrSelectionShape which can be many. Try referring to it like this: Code:
If Not myselection Is Nothing Then myselection.Shapes.All.OrderToBack Code:
If Not myselection Is Nothing Then myselection.Shape(1).OrderToBack |
#3
|
|||
|
|||
![]()
Hi,
I wrote the Artwork Optimizer in collaboration with a laser guy. His test case was 6000 objects which the optimizer rearranges in less than 10 seconds. This is a commercial tool, but affordable. http://www.coreldrawtools.com/artwor...ard/index.html -James Leonard Last edited by jemmyell; 06-08-2010 at 18:14. Reason: spelling |
#4
|
|||
|
|||
![]()
Hi John
I think Ive managed to do this using excel to sort the circles and then recreating the image from the sorted list. That said, the results are crude - it breaks the image into 2cm slices and orders all the circles in that strip from top to bottom (no snaking up and down). The code If Not myselection Is Nothing Then myselection.Shape(1).OrderToBack seems to have a syntactical error but the line If Not myselection Is Nothing Then myselection.Shapes.All.OrderToBack seems to work but in fact nothing has changed after the macro is run although this may be due to the other parts of the macro. I had a look at your optimizer James which looks just like what I need. I suspect I'll be buying it. Thanks nic |
#5
|
|||
|
|||
![]()
Hi James
Just a note to say I tried your reordering program and liked it very much. nic |
#6
|
|||
|
|||
![]()
Hi nic,
Thanks for the compliment! I hope you get a lof of use out of it. Do you use any commercial lasers that take DXF files directly? -James |
#7
|
|||
|
|||
![]()
Hi James
Yes your program really is very good. I wish I had more use for it tho! I did however recommend it to the laser cutting shop. This is the first time Ive sent artwork for laser cutting so I cant comment yet. Best wishes nick |
![]() |
Tags |
order laser cutting |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CAD/CAM cutter tool paths in Corel Draw | cncrouter | New product ideas | 11 | 13-07-2010 17:48 |
Laser cutting puzzles | tacarey | Jigsaw Puzzle Creator | 5 | 25-11-2009 15:56 |
Plot Graphics With Rolan CX-300 Cutter | m31uk3 | Code Critique | 1 | 12-10-2007 00:46 |
laser printer, glossy stock, registration problem in draw | joan | General | 5 | 29-05-2006 22:13 |
Corel to DXF - curves too jagged for laser cut out letters | knight74 | New product ideas | 2 | 19-02-2004 08:49 |