PDA

View Full Version : Deleting duplicate curves in Corel



David Friedman
11-18-2006, 11:48 PM
I have finally tired of vector cutting or meticulously deleting duplicate curves from Corel drawings that present this problem. My solution is crude, but works well. I have written a small Visual Basic routine in Corel 12 that automatically deletes all of the duplicate curves.

This routine considers curves to be duplicate if they have the same number of nodes as each other, and that each of the corresponding nodes in the curves are identical. Fills and other attributes are not considered.

Also, all text and "perfect" type shapes will be converted to curves, so you may want to save a copy of the original with some other name. I recommend this for all users anyway.

I'm new here so I don't know if I attached the file properly, but it can be found at www.creativeproco.com/documents/NoDups.txt (http://www.creativeproco.com/documents/NoDups.txt).

Good luck and don't forget to backup before using!

Dave

Tim Goldstein
11-19-2006, 11:34 AM
Dave,

Can you provide a little instruction on how to use the text listing of the VB program in CorelDraw? I see the VB editor, but not quite sure how to get from the VB text listing to something I can use in Corel.

Thanks,

Shaddy Dedmore
11-19-2006, 1:37 PM
David, I made your macro into a GMS, and put it here (http://www.shaddysengraving.com/laser/NoDupes.gms). It works in X3, haven't tried it in other versions.

I made no alterations to the code, it's strictly cut and paste. I'll take it down if you want me to.

Take the GMS and drop it in your C:\Program Files\Corel\CorelDRAW Graphics Suite 13\Draw\GMS directory

Shaddy

Lee DeRaud
11-19-2006, 4:28 PM
Can you provide a little instruction on how to use the text listing of the VB program in CorelDraw? I see the VB editor, but not quite sure how to get from the VB text listing to something I can use in Corel.If you did the default installation, there should be a 'Documentation' submenu under 'Start|Program Files|CorelDRAW Graphics X3 Suite'. The file "CorelDRAW VBA Programming Guide for X3" has probably more than you want to know on the subject. To get started, just use the 'File|Import' command in the VBA editor to load David's text file.

David Friedman
11-19-2006, 6:46 PM
I'm fairly new to Corel and don't know what the GMS is. I'll check it out, though.

For now, the easiest way to use it in VB is to highlight the text, copy it to the Windows clipboard (Ctrl-C), open the VB editor (Alt-F11), and paste the text into the editor (Ctrl-V). Save the VB file (Ctrl-S) and close the editor (Alt-F4). Next, in Corel, with your drawing active, select Tools, Visual Basic, Play and you should see NoDups in the list (probably the only thing in the list). Select NoDups and it will run. Be sure to backup your file before you do this in case of problems.

I have written this from memory so there may be some mistakes here. Also, be aware that this method (at least on my installation) will paste the program into a location that is accessable only when the same drawing file is active. You'll have to look around patiently to figure it out, but I put my VB routines in the GlobalMacros file so that they are always available.

Good luck with that!

Dave

Shaddy Dedmore
11-20-2006, 1:42 AM
A GMS file is a way to have the macros available for all files, without putting the macros in the Global file. It's also a little easier (but not a lot) to get the end user to get it up and running. By putting the GMS file in the right directory, it's available for all files through the Play command. That's all without opening the VB editor that someone new to VB would find overwhelming.

PS, to create a GMS file, the easiest way I can see is to make a copy of one within Explorer, then rename it, then open it within VB Editor and make the changes.

Shaddy