home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
multiplot_467.lzh
/
Multiplot
/
Docs
/
txt_2_icad.doc
< prev
next >
Wrap
Text File
|
1991-03-10
|
3KB
|
72 lines
Intro-CAD saves drawings in binary files. This allows drawing
coordinates to be written and read very quickly and with full accuracy.
It also yields very much smaller drawing files.
But the binary format is likely to be inconvenient for the purposes
of those knowledgeable users who might want to, say, automatically
generate "drawings" with a computer program for display by Intro-CAD, or
use Intro-CAD to plot data, etc. Intro-CAD does a good job of "drawing"
on dot-matrix printers, for example, and some users may want to use
this capability by itself.
The programs txt_2_icad and icad_2_txt translate between Intro-CAD's
binary file format and an ascii (text) file format. These programs
must be run from the CLI.
The program txt_2_icad reads a text file with an extremely simple and
forgiving structure and generates a binary file that Intro-CAD will
treat as one of its own files. Thus, all users get the benefit of a
binary file format for loading and saving, while the few users with
special needs can work their magic without the hassle of an inconvenient
and non-standard file format. To use this program, type
TXT_2_ICAD TXTFILENAME CADFILENAME
where TXTFILENAME is the name of an existing text file, in the format
described below, which is to be translated. CADFILENAME is the name
you want the new Intro-CAD drawing file to be called.
The program icad_2_txt does the reverse translation. To use this
program, type
ICAD_2_TXT CADFILENAME TXTFILENAME
where CADFILENAME is the name of an existing Intro-CAD drawing file and
TXTFILENAME is the name you want the new file to be called.
Here is the file format:
x1 y1
x2 y2
.
.
.
xn yn
(optional flags)
x1, y1, etc., are horizontal and vertical coordinates of points
to be connected by lines when displayed. These may be integers, real
numbers, or a mixture of the two. Lines containing the optional flags
(one per line) begin with a '*'. The flags are completely described in
comments to the following sample file.
Here is a sample text file suitable for input to txt_2_icad.
(In fact, this entire file is suitable because txt_2_icad ignores lines
which don't begin with two numbers or an asterisk. More correctly, it
treats such a line as the separator between two "lists" of coordinates
which make up an Intro-CAD "primitive object". A blank line is the
usual separator.)
*D 4 This sets the default color for objects which follow. (It's ok
to redefine the default color later in the file.)
100 100 This is a box..
100 200
200 200
200 100
100 100
*> The object above this mark is in a group with the object below it.
*C 4 The object above is in color 4 (whatever color that may be)
*L 2 The object above is to be rendered in Intro-CAD line type 2
125 150 This is a line..
175 150
*C 5 ..in color 5 and line type 0 (solid) since no "*L"