OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21-03-2007, 04:34
Funky
Guest
 
Posts: n/a
Default Converting CMX to CDR (X3)

Hi there,

I have got a load of CMX files, categorized in several folders.
My intention is to convert them to CDR files. I want to do that with the image converter (in DRAW, Extra>Visual Basic>Start>File Converter.gms). This converter works fine and I can batch process the whole content of a folder.
No problem so far.
But this converter saves the CDR files as version 13 and I want CDR fils as version 10. In the File Converter window I cannot choose the version number.

I've tried to make a 'custom' macro:
Visual Basic: Record, open a CMX file, save as CDR version 10, close, stop macro. But when I run this script only that CMX file will be converted, nothing more.
I see here some recognition with the scripting of Photoshop. But if I want to run a script in Photoshop I can choose the 'read' and 'save' folder.

How can I solve this problem?
I'm defenately not a VBA coder.

Greetz,
Funky
Reply With Quote
  #2  
Old 02-05-2008, 06:12
Funky
Guest
 
Posts: n/a
Cool

Hi again,

It seems that I've asked a very hard question, when I look at the number of views and replies of this thread.
The problem still isn’t solved.

Read the following steps I’ve taken. I hope someone will follow me.
In CorelDRAW X3 (‘Extra’, ‘Visual Basic’, ‘Start’, ‘FileConverter’, I’ve opened the FileConverter.gms in the Visual Basic Editor. I’ve opened the folder ‘Forms’. In this folder I doubleclicked in ‘frmFileConverter’. What you see now is the context window of the file converter. When I right click on this window I choose ‘Show code’, I see a really long list of the code.
I have no idea where in this code I can alter the fileversion of the exported CDR-file (I guess that’s possible, because when I manually save an CMX as CDR, I can set the version number in the ‘Save as’ window.

Please help!
I appreciate any respond.

Greetz,
Funky
Reply With Quote
  #3  
Old 02-05-2008, 12:57
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Find the following code in the source for frmFileConverter form:

Code:
If PageAsSeparateFile Then
    For Each p In d.Pages
        CurFileName = GetNewFileName(frmSourceSelection.lstSelectedFiles.List(n), cboFileFormat.Text, DestDir, p.Index)
        p.Activate
        d.SaveAs CurFileName
    Next p
Else
    CurFileName = GetNewFileName(frmSourceSelection.lstSelectedFiles.List(n), cboFileFormat.Text, DestDir)
    d.SaveAs CurFileName
End If
And change it as follows:

Code:
Dim opt As New StructSaveAsOptions
opt.Version = cdrVersion10
If PageAsSeparateFile Then
    For Each p In d.Pages
        CurFileName = GetNewFileName(frmSourceSelection.lstSelectedFiles.List(n), cboFileFormat.Text, DestDir, p.Index)
        p.Activate
        d.SaveAs CurFileName, opt
    Next p
Else
    CurFileName = GetNewFileName(frmSourceSelection.lstSelectedFiles.List(n), cboFileFormat.Text, DestDir)
    d.SaveAs CurFileName, opt
End If
(added code is highlighted in red)
Reply With Quote
  #4  
Old 03-05-2008, 05:44
Funky
Guest
 
Posts: n/a
Default

Hi Alex,

Thnx for the quick reply.
I altered the code the way you told me. The fileconverter now saves the files as CDR version 10.
Many thnx!

After examination of the altered files I discovered that the fileconverter sometimes randomly skippes some files. I had a test folder containing 967 CMX files. After the batch conversion the new folder contains 513 files. It doesn't matter if I convert the files to AI, WMF or CDR. Everytime the amount of converted files is 513. And everytime the same files are skipped. Maybe this issue was present all the time.
When I manually open these CMX files everything looks normal and I can save this file to whatever I want.

Do you have any idea what the problem of that is? Now I can't rely on the fileconverter and I must check the content of every folder (more than 900!). I don't want to think about the remained files that I must convert by hand.
Too much human factor in this proces.

Maybe you got an answer.
Thnx & greetz,
Funky
Reply With Quote
  #5  
Old 03-05-2008, 22:32
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Could it be that you have files with extended characters in their names (like Greek, Cyrillic, Turkish, etc characters)? If so, that could be your problem...
Reply With Quote
  #6  
Old 04-05-2008, 15:30
Funky
Guest
 
Posts: n/a
Default

I'm sure that's not the problem.
I did a convert test with the original CMX files.
After that I renamed these original CMX files with a file rename tool. I renamed all the files with an equal 4 character name followed by an unique ascending number. The same file skipping in the convert process occurred.

I am wondering what causes the skipping of files. If those files are corrupt, why can I open these files manually?
Reply With Quote
  #7  
Old 05-05-2008, 21:35
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Can you attach a few sample CMX files (ZIP them)? Or send them to be to alexv@oberonplace.com and I'll take a look...
Reply With Quote
  #8  
Old 23-05-2008, 19:40
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Hi,

Sorry it took so long getting back to you... I had my computer fried and it took me quite some time to replace it and reinstall all the software..

I looked at the samples you've sent. Apparently the CMX files that are skipped contain some layers in them... There is a problem with the macro that prevents it from converting those files correctly.

Anyway, you can patch the problem with the following code change. Open the source code for frmFileConverter form in VBA editor and search for the following line:

Code:
si.MaintainLayers = True
Change it to:

Code:
si.MaintainLayers = False
That should do the trick.
Reply With Quote
  #9  
Old 27-05-2008, 07:39
Funky
Guest
 
Posts: n/a
Default

Hi Alex,

Sorry to hear that your PC did burn down. The positive thing is that you can look for new hardware.


But...
It's a long time ago that someone made me that happy!
The alteration you mentioned in the frmFileConverter about the layer thing works! I've got 100% output here.

I think I'll put the frmFileConverter file in a fire proof vault with some guard dogs around it. Is it enough to export the file FileConverter.gms? Or must I export more files to ensure a proper file converter after a DRAW re-install?

Again thnx and greetz,
Funky

Last edited by Funky; 27-05-2008 at 07:49.
Reply With Quote
  #10  
Old 27-05-2008, 18:19
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Just back up the whole GMS file. Just look for "FileConverter.gms" in "C:\Program Files\Corel\CorelDRAW Graphics Suite X4\Draw\GMS" or whatever your installation path is...
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
CMX file format documentation Alex FAQ 1 02-08-2007 20:38
delete vba project from cdr file hotairballoon CorelDRAW/Corel DESIGNER VBA 1 18-05-2005 09:08
Show default icon for CDR files in Windows Explorer Alex FAQ 0 27-04-2005 11:10
Importing only 1st page from a multipage CDR mecanomaniaco CorelDRAW/Corel DESIGNER VBA 3 28-02-2005 17:21
Pausing CDR using DoEvents jspatzier CorelDRAW/Corel DESIGNER VBA 2 03-12-2002 11:43


All times are GMT -5. The time now is 07:44.


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