[comp.sys.mac] MacDraw File Format?

berger@datacube.UUCP (01/15/87)

Does anyone have a document that describes the MacDraw file format?
Or better yet some C code that would parse the MacDraw file format!

I'm planning to write some code for taking a MacDraw file and convert it
to other formats (in particular MIF for Frame maker, pic for unix maybe).

If anyone has any tips or suggestions (or they've done something like
this already), please drop me a note. I'll sumarize for the net.
				Bob Berger 

Datacube Inc. Systems / Software Group	4 Dearborn Rd. Peabody, Ma 01960
VOICE:	617-535-6644;	FAX: (617) 535-5643;  TWX: (710) 347-0125
UUCP:	ihnp4!datacube!berger
	{seismo,cbosgd,cuae2,mit-eddie}!mirror!datacube!berger

howard@amdahl.UUCP (01/17/87)

In article <105800001@datacube> berger@datacube.UUCP writes:
>
>Does anyone have a document that describes the MacDraw file format?

I believe Tech Note #27 is the source of all knowledge in this area.

>I'm planning to write some code for taking a MacDraw file and convert it
>to other formats (in particular MIF for Frame maker, pic for unix maybe).

Don't ask me why, but the other night I wondered just how hard it would be
to turn a PICT format file into Unix pic format.  Well I have a prototype.
It handles lines, rects, roundrects (as rects), ellipses, rudimentary text,
and various opcodes that don't translate to a pic environment.  In the
process, I learned some hard, cold reasons why diagramming on the Mac beats
pic hands down (*I* needed no convincing).  The main problem is that pic is
vector oriented, not raster.  So you can't really "paint a rect" or erase
a rect.  Most of the best features of MacDraw/Superpaint/whatever won't
work in a pic environment.  The best you can do is reasonable transfer of
"wire frame" diagrams.  Well I have yet to implement polys and do something
with regions (does anyone know the format of region data?).  And improve
text processing.  When I'm done, I'll see if I can post it to the net.
No promises though, this is a software development shop.

-- 
"Plan for the future because that's where you                Howard C. Simonson
    are going to spend the rest of your life." {hplabs,ihnp4,nsc}!amdahl!howard
         - Mark Twain -

[ The disclaimer for this message may be found in my next article ]

weber@brand.UUCP (Allan G. Weber) (01/22/87)

> 
> Does anyone have a document that describes the MacDraw file format?
> Or better yet some C code that would parse the MacDraw file format!
> 

I have just what you need.  Sometime back I wrote a program called
"drawimp" that translates a MacDraw picture saved in MacDraw format
into Impress commands for printing on an Imagen laser printer.  In the
process of writing the program I had to decipher much of the MacDraw
internal file format.  I can send you (or post) a file with my notes
on the file format, or if there is enough interest, I can do the same
with the whole drawimp program.  We use the program quite a bit here
for changing MacDraw pictures into Impress so they can be merged with
the output of TeX and LaTeX documents to eliminate cutting and pasting
of pictures.  It's not too elegant or sophisticated, but it works.

				Allan Weber
				USC Signal & Image Processing Inst.
				Arpa: weber%brand@usc-oberon.usc.edu
				UUCP: ...sdcrdcf!usc-oberon!brand!weber

dgold@apple.UUCP (01/23/87)

In article <835@brand.UUCP> weber@brand.UUCP (Allan G. Weber) writes:
>...  Sometime back I wrote a program called
>"drawimp" that translates a MacDraw picture saved in MacDraw format
>into Impress commands for printing on an Imagen laser printer.  In the
>process of writing the program I had to decipher much of the MacDraw
>internal file format.
It's really not a good idea to depend on the format of MacDraw format files.
Apple has stated in the past that this format is subject to change in the
future.  The PICT format option in MacDraw is there precisely to satisfy the
needs of people for transferring information out.

For those not familiar with the PICT format, it's described in Tech Note
#27.  Basically, it consists of a 512 byte header, followed by a regular
QuickDraw picture.  This picture can be interpreted by either reading it
into a handle and playing it back (you can use the QD bottleneck procs to
get the data coming out of the picture and convert it to another format),
or by setting the QD bottleneck which gets picture bytes and pulling it
out of the file directly (if the picture is too big to fit in memory all
at once).

By using MacDraw PICT format and the QuickDraw bottleneck procs, you can
insulate yourself from changes in both the MacDraw file format and the format
of a QuickDraw picture.


-- 
David Goldsmith
Apple Computer, Inc.
MacApp Group

AppleLink: GOLDSMITH1
UUCP:  {nsc,dual,sun,voder,ucbvax!mtxinu}!apple!dgold
CSNET: dgold@apple.CSNET, dgold%apple@CSNET-RELAY

segall@caip.UUCP (01/26/87)

Please, please post or send the info about decoding MacDraw files. I
would very much like to be able to automatically decode them.

Thanks,

Ed Segall

PS Does this decode anything produced by MacDraw, or are there
restrictions?


{seismo, harvard, ut-sally}!topaz!caip!segall
segall@caip.rutgers.edu

dorner@uxc.cso.uiuc.edu.UUCP (01/28/87)

> It's really not a good idea to depend on the format of MacDraw format files.
> Apple has stated in the past that this format is subject to change in the
> future.

Unfortunately, I don't agree.  I've been waiting a long time for Bug fixes
for MacDraw, and haven't seen diddly.  So if Apple isn't fixing bugs, I
can't imagine they are going to change file formats.  It rather seems that
MacDraw is an orphan (or at least disinherited).  This is a shame, because
it is really a nice program.

Or do you know something we don't?

> The PICT format option in MacDraw is there precisely to satisfy the
> needs of people for transferring information out.

In my opinion, the PICT format option in MacDraw is there so MacDraw
can remember which fonts I used if I used one further down than 11 in
the menu, or if I switch system disks.  I don't use the MacDraw format
for ANYTHING anymore.  If only I'd figured this out before having used
the program for a year.

> -- 
> David Goldsmith
> Apple Computer, Inc.
> MacApp Group
--
Steve Dorner
dorner@uxc.cso.uiuc.edu

liberte@uiucdcsb.UUCP (01/29/87)

I understand from a friend that in order to *generate* a PICT file
that MacDraw can read, you do NOT want to put PICT as the first four
bytes of the header since MacDraw looks at the rest of the 512byte
header and there is no easy way to figure that part out.   Instead,
put 0s in the first four bytes, and MacDraw won't look at the rest of the
header.


Dan LaLiberte
liberte@b.cs.uiuc.edu
liberte@uiuc.csnet
ihnp4!uiucdcs!liberte

spry@uiucdcsm.UUCP (01/29/87)

	While we are discussing PICT vs. MacDraw formats, how can you modify
MacDraw so that it will produce PICT format output files by default?  I would
assume that you can do it with ResEdit or REdit.  I haven`t poked around to
find a way yet so if someone has already done it it will save me the time of
looking for it.  I would like to use the PICT format outputs but too often I
forget to click on the radio button to change the format before saving a file.

Andy Spry

             +-----------------------------------------------+
             |  The above opinion is mine only and subject   |
             |      change with the amount of sunshine.      |
             +-----------------------------------------------+
             |   I can be reached at:                        |
             |          arpa           spry@m.cs.uiuc.edu    |
             |                  or     spry@uiuc.ARPA        |
             |          csnet          spry@uiuc.csnet       |
             |          usenet         uiucdcsm!spry         |
             +-----------------------------------------------+

erikl@inmet (10/20/89)

	Can anyone tell me where to find documentation for the internal
	file format used in MacDraw?  I want to compute the total
	length of a lot of circuits, each consisting of mutiple line
	segments, in a scaled drawing.

	Thanks,

	-Erik Leo
	 erikl@inmet.inmet.com
	 erikl%inmet@uunet.uu.net
	 uunet!inmet!erikl