Full Version: Unscale Rectangle

From: Carl (CSEWELL) [#1]
 13 Oct 2006
To: ALL

All;

The attached macro simply removes the scaling from a rectangle so that the rounded corners will be uniform. The code is based on the AddBoundingBox macro, which is primarily why it finally got written.

Usage: Select a rectangle and then run the macro.

Let me know if it works for you.

Edit: I may have wrongly assumed that people would understand the reason for this macro. Maybe not. Here's a slightly more in-depth explanation. When you create a rectangle(square) and use the shape tool to round the corners, any non-uniform re-sizing of the rectangle will cause the radii to become non-uniform. The fix is to redraw the rectangle(square) at the re-sized size, or run the UnscaleRectangle macro which will do that for you. It will even delete the old one. I think this was fixed in X3 (nope, I don't have X3), so X3 users can ignore this one.

EDITED: 13 Oct 2006 by CSEWELL


From: PenTrophy (PENINSULATROPHY) [#2]
 13 Oct 2006
To: Carl (CSEWELL) [#1] 13 Oct 2006

Are the macros written for a specific version of CDR or will they work with all, ie CDR ver 9 and 11 ( 12 or x3 only ) ?

Thanks for your work.


From: Carl (CSEWELL) [#3]
 13 Oct 2006
To: PenTrophy (PENINSULATROPHY) [#2] 13 Oct 2006

Unfortunately, I only have V12, so that's all I can write for.

Theroretically, the macros should work on any version of CorelDraw that supports VBA. I'm not even sure when VBA (Visual Basic for Applications) was added to CorelDraw. Anyone have the answer? The pre-cursor to VBA was CorelScript. VBA is different from CorelScript, although CorelScript is still in-use. In fact, some of the VBA macros can and do call CorelScript commands.

I haven't had any reports that the macros do not work for certain versions of CorelDraw. If you discover a problem with a macro and a certain version of CorelDraw, please post a message to the forum.

And, if you'd like more information on installing a VBA macro or how to add a macro command to your toolbar please see message 4364.2

From: PenTrophy (PENINSULATROPHY) [#4]
 13 Oct 2006
To: Carl (CSEWELL) [#3] 13 Oct 2006

I punched up "help" in 9 and it says VBA can be used.... I will try and get back... "The old timers test cell"


Now I just have to find the disks so I can load the VBA files.....arrfff!

EDITED: 13 Oct 2006 by PENINSULATROPHY


From: Laser Image (LASER_IMAGE) [#5]
 13 Oct 2006
To: Carl (CSEWELL) [#1] 13 Oct 2006

I just drew a rectangle and set the corners to 15, dragged it to a larger size and the corners stay at 15. Then I drew another rectangle approximately the same size as what I dragged the other one to and set the corners at 15 - they are identical to the one I dragged. So, to make a long story short, they fixed it in 13 / X3.

Gary


From: Carl (CSEWELL) [#6]
 13 Oct 2006
To: Laser Image (LASER_IMAGE) [#5] 13 Oct 2006

Thanks for verifying that the 'feature' was fixed in X3.

From: Pedaler (ROYBREWER) [#7]
 13 Oct 2006
To: Carl (CSEWELL) [#6] 13 Oct 2006

Carl,

X3 works the same as it always has when rounding the corners to a scaled rectangle. Gary's test shows only that it kept the same % roundness (but of the original rectangle).

The "fix" is to use X3's Fillet/Scallop/Chamfer docker. It allows absolute values (instead of %) and prompts user to allow it to "undistort" the object.

Your macro, then, will be useful to X3 users also if they are used to putting in percentage radius rather than absolute value (the docker's only option). Also, the docker applies the absolute to *all* "corners" whereas using your macro and the "old" method allows us to radius whichever corners we need and even different corners to different radius.

This post makes it sound like the new Fillet/Scallop/Chamfer docker is not that useful, but not so; I consider it worth the price for the upgrade. e.g., we can now fillet *any* shape, not just a rectangle!

EDITED: 13 Oct 2006 by ROYBREWER


From: Carl (CSEWELL) [#8]
 13 Oct 2006
To: Pedaler (ROYBREWER) [#7] 17 Oct 2006

Interesting, thanks!

There are two different sets of values for setting corner radii through VBA: one is the percentage and the other is absolute (ie 1/4"). I took a quick look and couldn't find a way to set the absolute value from within CorelDraw (outside of VBA). You can set a default value for percentage roundness in the options, but there isn't a setting for an absolute value. Do you know how to set a radius absolute value from within CorelDraw?

If it can't be done easily from within CorelDraw, would a macro that allows you to specify an absolute size for the corner radius be useful (ie for pre-X3 users)? It's a little more involved than the UnscaleRectangle macro but only because it will require a dialog box.

Hey, this may also be an easy way to create chamfers also! You'd need to convert the rounded rectangle to a curve and then convert all curves to lines (1-step).

Interesting stuff..............

Back to thread list | Login

© 2024 Project Beehive Forum