home *** CD-ROM | disk | FTP | other *** search
- { These procedures generate AUTOCAD readable files in .DXF -format
-
- init (filename) opens the file and outputs the first introductory
- remarks to it. The filename should have the extension .DXF.
-
- movea(x,y) moves the pen to a position x,y without drawing
-
- drawa(x,y) draws a line from the current position to x,y
-
- finit closes the file
-
- }
-
- type dxaugrafiletype=string[20];
-
- var xmomaugraf,ymomaugraf:real;
- dxaugrafile:text;
-
- procedure init(filename:dxaugrafiletype);
- {open the file for output }
-
- begin
- assign(dxaugrafile,filename);
- rewrite(dxaugrafile);
- xmomaugraf:=0.;
- ymomaugraf:=0.;
- writeln(dxaugrafile,'0');
- writeln(dxaugrafile,'SECTION');
- writeln(dxaugrafile,'2');
- writeln(dxaugrafile,'ENTITIES');
- end;
-
- procedure finit;
- {close the file}
- begin
- writeln(dxaugrafile,'0');
- writeln(dxaugrafile,'ENDSEC');
- writeln(dxaugrafile,'0');
- writeln(dxaugrafile,'EOF');
- close(dxaugrafile);
- end;
-
- procedure movea(x,y:real);
- { moves the current pointer to a new position }
- begin
- xmomaugraf:=x;
- ymomaugraf:=y;
- end;
-
- procedure drawa(x,y:real);
- { Draws a line from the current position to x,y }
- begin
- writeln(dxaugrafile,'0');
- writeln(dxaugrafile,'LINE');
- writeln(dxaugrafile,' 8');
- writeln(dxaugrafile,'0');
- writeln(dxaugrafile,' 10');
- writeln(dxaugrafile,xmomaugraf:8:6);
- writeln(dxaugrafile,' 20');
- writeln(dxaugrafile,ymomaugraf:8:6);
- writeln(dxaugrafile,' 11');
- writeln(dxaugrafile,x:8:6);
- writeln(dxaugrafile,' 21');
- writeln(dxaugrafile,y:8:6);
- xmomaugraf:=x;
- ymomaugraf:=y;
- end;