OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Oberon Products > New product ideas

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 13-03-2009, 23:46
Spud
Guest
 
Posts: n/a
Default Auto border macro

Hi everyone, had a quick look around and this seems like the right place to post.

I'm trying to find a macro that will allow me to apply a predefined border in coreldraw.

I've just started work in a sign shop that specialises in road and safety signs.
All the design work is done in coreldraw. My first day on the job I designed around 30 or so signs of various sizes.
Now although the size of the signs is a variable, there are only 3 or 4 different
types of border combinations.

For example, a 900mm x 1200mm aluminium sign has 40mm radius corners and a 16mm thick black border which is inset 8mm from the edge of the sign. This black border also follows the 40mm radius.
Any sign roughly 200mm larger or smaller will still have the same radius corners and border size.
So my ideal macro would have me entering the page size (sign size) then letting the macro apply the radius and border settings.

I have tried using the VB recorder in corel with no luck.
Here's what I recorded after the page size was set...

Layout/page setup/add page frame (to make outline of page size)
Convert (page frame) to curves
Fillet radius 40mm
Contour inside 8mm then break contour group apart
Select the inside contour and contour again inside 40mm
Break contour apart then combine the two giving it a black fill.

I save the macro to the global group

When I replay the macro a couple of things go wrong.
Firstly, if my new page size is different than the recorded one, it changes my page size accordingly.
Secondly, when it gets to the break contour apart command the macro stops with a runtime error.

Now I've really fumbled along to get as far as I have, so any words of advice or pointing me in the right direction to find such a macro would really be appreciated.

Cheers & thanks for reading through
Tim
Reply With Quote
  #2  
Old 14-03-2009, 23:41
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 Getting started...

This should get you started, it does the basic steps you are looking for.
Code:
Sub CreateSign()
    Dim s As Shape
    Dim sFirstContour As Shape, sSecondContour As Shape
    Dim srContours As New ShapeRange
    
    ActiveDocument.Unit = cdrMillimeter
    
    Set s = ActiveLayer.CreateRectangle2(0, 0, 600, 600) 'Create the outside shape
    s.Fillet 40, True 'Apply the Radius to each corner
    
    Set sFirstContour = s.CreateContour(cdrContourInside, 8, 1).Separate(1) 'Create the first inner contour shape
    Set sSecondContour = sFirstContour.CreateContour(cdrContourInside, 16, 1).Separate(1) 'Create the second inner contour shape
    
    srContours.Add sFirstContour 'Add contour to shaperange
    srContours.Add sSecondContour

    Set s = srContours.Combine 'Combine shaperange into single shape
    
    s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100 'Fill with
End Sub
Best of luck,

-Shelby
Reply With Quote
  #3  
Old 15-03-2009, 07:19
Spud
Guest
 
Posts: n/a
Default

Thanks Shelby, I'll give this a shot.
Appreciate your time & effort.

Cheers
Reply With Quote
Reply


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
Help resize the border masterchiefph CorelDRAW/Corel DESIGNER VBA 1 09-07-2007 21:26
unwanted margin/border around exported objects michael_maberly General 5 28-05-2007 18:38
View>Show>Page Border ddonnahoe CorelDRAW/Corel DESIGNER VBA 1 22-08-2006 13:51
diffusion effect on the pic's border leopardo General 1 08-08-2005 08:49
New macro to clip curves w.r.t. a border Gerard Hermans Macros/Add-ons 0 09-06-2003 07:50


All times are GMT -5. The time now is 22:52.


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