Register | Login
Attackpoint - performance and training tools for orienteering athletes

Discussion: converting ocad file to an older version

in: Orienteering; Gear & Toys

Mar 7, 2011 5:18 PM # 
izra:
Hey all,
I got a .ocd 8 file and I want to convert it to an .ocd 7 or 6 file.
I don't have ocad license, only the ocad 10 trial version.

How I can do it?

Thank you.
Advertisement  
Mar 7, 2011 5:34 PM # 
JLaughlin:
Get someone else(with a license) to do it for you?
Mar 7, 2011 8:54 PM # 
lorrieq:
Send me the file and I'll do it. lorrieq@hotmail.com
Mar 7, 2011 9:30 PM # 
TheInvisibleLog:
Don't convert to OCAD 6. It will change the bezier curves into many points and make the file much larger.
Mar 7, 2011 9:39 PM # 
eddie:
I've never seen ocad6 conversions do that before. People convert from 8 to 6 for me all the time with no problem - curves come through fine. Are you seeing it with a specific ocadver to 6?
Mar 7, 2011 11:12 PM # 
TheInvisibleLog:
Ocad 9. I have had all sorts of problems getting between that and the demo OCAD6.
Mar 7, 2011 11:23 PM # 
eddie:
Is your ocad9 patching up to date? I didn't see anything obvious in the update notes related to a bug like this, but maybe make sure you are patched to 9.7.1 (http://www.ocad.ch/en/downloads.htm). Is it Standard or Pro? And does the same thing happen when converting to 7 or 8?
Mar 8, 2011 5:04 AM # 
izra:
There is no way to convert it without giving it to someone with a license?
Mar 8, 2011 5:52 AM # 
jjcote:
The file formats are published, so you could write a program to read the file and write it out in the other format. If you're skilled, you could probably do this in a weekend. But it's probably easier to just let someone with a license do it, which will take less than a minute.
Mar 8, 2011 6:01 AM # 
Juffy:
The file formats are published, so you could write a program to read the file and write it out in the other format. If you're skilled, you could probably do this in a weekend.
You sound like someone who hasn't actually tried to DO this. :)
Mar 8, 2011 7:55 AM # 
rockman:
check the file size of the converted file - for conversions from OCAD9 to OCAD7 or OCAD6 the output file can be as much as 300-400% bigger than it needs to be. The only way I have found to fix this is to open the file in O7 or O6 and it, then save again.
Mar 8, 2011 12:32 PM # 
jjcote:
You sound like someone who hasn't actually tried to DO this. :)

Back in the days of 0CAD 3 (1992, to be specific), when I was drafting with a monochrome monitor and making backups on 5.25" floppies, 0CAD used to save a map using two files, MAP.IDX and MAP.ELT (instead of just MAP.OCD). Due to some complicated unfortunate circumstances, the .IDX file for a huge map I was working on got destroyed, and one of the backup disks I was using turned out to be defective. I had sent copies of the map in progress to the course setter a week earlier, so I had the option of losing a week of work, or trying to salvage what I had left. It turned out that the .ELT file contained all of the necessary information, so it was possible to reconstruct the .IDX file from it. In the process, I wound up writing some tools to do various other things like adding a few new symbols, and the course setter wrote tools to stretch or rotate a map (which 0CAD 3 didn't do). I maintained the tools for a while, but abandoned them probably around 0CAD 5.
Mar 8, 2011 2:38 PM # 
eddie:
rockman, do you know if the increased file size you are seeing is due to bezier curves being "transformed" into vectors? Or are the curves coming through ok but the file size is just larger?

The simplest way I can think of for the bezier curves to be converted to vectors is for the tag indicating a curve being accidentally set to that of a vector such that the 4-pair of bez coords per segment (two ends, two control points) are interpreted as just 4 sequential points on a vector line. For a tight fitting curve this might not be noticeable, but if the control points are well off the line this would look really wacko. Also, this would not result in a change in the file size - it would stay the same.

If the curves are being *explicitly* converted to vectors the code would have to evaluate the bez at a set of points (the number of which has to be established) between each end point. I don't think any version of ocad has a user tool to convert curves to vectors, although all versions must use something like this when actually drawing the bez curves on the screen.
Mar 8, 2011 2:41 PM # 
Juffy:
JJ - I stand corrected. :)

*bows quietly and goes back to trying to decipher the v9 format*
Mar 8, 2011 2:51 PM # 
eddie:
I've written ocad5 and ocad6 reader/writers (not version converters). I use some simplifications though, like not generating or modifying symbol tables from scratch. My writers read the symbol block from an existing ocad file and then write that block unchanged to the new file. If I want to write with a new symbol I have to first create that symbol in ocad, save a sample file, and read the table from that file before I can use it for writing. Mostly I use them to write vectors or bezier curves of contours (from lidar) and vectors read from .shp files (which ocad6 can't import directly), and for "rubbermap" distortion. It took me MUCH more than a weekend to write the original ocad5 tools :), but I think I subsequently wrote the ocad6 ones in a weekend. Has anyone written any stand-alone ocad format converters?
Mar 8, 2011 3:09 PM # 
eddie:
Looking back at the bezier storage format in ocad5, the points are stored as ecceXcceXcceXcce, where e=endpoint, c=controlpoint and X is a "bezier tag." When the bez tag is encountered it knows to use the previous endpoint as the start point for the next segment, so even though a bez curve would only need 3 points per segment after the first, the interspersed tags force them to retain the 4 coord pairs per segment in the saved file. The bez tag is [-32766,-32766].

So if ocad9 was simply interpreting curves as a vector of coord pairs I'd expect to see a jump to this "coord" every 4th point, producing a wild fan shape in the drawn output (and no change in the file size, and assuming ocad isn't checking for tags when plotting what it thinks are vectors). But I'm just guessing.

If someone (TheInvisibleLog?) can post a simple ocad9 file with some drawn bez curves (just draw a few by hand to keep it simple), converted to ocad6 showing it converting to vectors I can have a look. Post both the ocad9 and ocad6 files please, and give me the exact version of the ocad9 using the "about OCAD" button under help. Or e-mail them to me.
Mar 8, 2011 8:47 PM # 
TheInvisibleLog:
The idea had been to use the demo version of OCAD6 for some club members who wanted to give mapping a try, and then convert their work into a later version. And in setting up base maps I needed to do conversion in reverse as well. The planned process was problematic. But version must make a difference. I stopped using OCAD6 some time ago due to the problems, and now I can't recreate the problems.

I did find one of the maps that was causing me problems in OCAD6. I can't import it into version 9. In fact, it just crashed OCAD9. If you like i can send that critter. I ended up redrawing the map so I don't need a problem solved. Its more a question of whether you get any joy from historic forensic work. I will be upgrading to version 10 in the next week or so anyway. This decision is driven by the imminent arrival of lidar data or our local area.

And yes, when these problems were happening, the beziers were converting to vectors as Rockman describes.
Mar 8, 2011 8:54 PM # 
eddie:
You're using 9.7.1 now and no longer seeing the problem, so you think an earlier version of 9 had the problem and a later patch fixed it? Just want to confirm.
Mar 9, 2011 2:33 AM # 
rockman:
eddie, file size is just larger (same number of symbols, objects), no apparent loss of bezier curves, etc in conversions

eg
O9 = OCAD version 9.4

test file size: 1146kb (current map, all sorts of symbol types, optimised - most of the contours are vector as they have not been modified from a dxf import)

saved as O7a: 6474kb

O7a file opened using O7 and optimised, saved as O7b: 976kb

O7a file opened in O9 re-saved as O9 without optimising in O7 :1118kb

O7a file opened in O9, re-saved as O9, with optimising in O7 :1118kb

same sort of file size variation going from O9 to O6.

I haven't tried to track down whether there is a particular symbol type that causes the bloated file, but it is something that I have encountered whenever I have saved as an older version.
Mar 9, 2011 4:14 AM # 
eddie:
Interesting, thanks. Looking though the bug fixes subsequent to 9.4.0 there is at least one thing related to writing 6/7/8 from ocad9. Not sure if its relevant, but would be interesting if you download the serviceupdate to bring your version up to 9.7.1 and re-run your tests to see if any of those changes fix the problem.

This discussion thread is closed.