HPGL2DXF.EXE Copyright 1992 Quantum Diagnostics, Inc. Elliott Linker A file conversion utility designed to read a plotter file written in Hewlett-Packard Graphics Language (HPGL), translate it to AutoDesk Drawing Exchange Format (DXF) and write the result to a file that may be imported by AutoCad as a drawing ready for viewing and editing. Designed to run on IBM and compatible PCs, it requires DOS 2.0 or later and 64k of free RAM. Strongly recommended are a math coprocessor and a hard disk, but if you're using AutoCad you probably have all this stuff anyway. And, as usual, the more MIPS and megahertz, the better. Designed to be distributed as ShareWare, a complete ensemble consists of these two files: HPGL2DXF.EXE (the utility in executable form) HPGL2DXF.TXT (this file) You may freely copy and distribute this material providing it is distributed in its entirety, two files, without modification or changes, with copyright notices and Quantum Diagnostics trademark intact, and provided that no charge is made except as to reasonably recover materials and distribution costs without profit. Reference documents used to create this utility were an operator's manual for Hewlett-Packard drafting plotters dated 1984 with a complete (at that time) specification of HPGL, a worn-out, discarded manual of AutoCad release 2, and a printout of a DXFOUT file generated by AutoCad release 10. Thus we purport the HPGL implementaion to be accurate to the HP manual specified within the bounds of the disclaimers stated in this document, and the DXF imple- mentation to be as accurate as our best guess at the time. To date we have had no complaints of syntactical violations of the DXF from any recipients of DXF files created by this utility. HPGL/2, which is supported by many laser printers and other modern graphic devices, is a superset of HPGL and is in general not supported where it exceeds the limits of HPGL (e.g: certain arguments that may be floating point in HPGL/2 must be integers in HPGL and for this utility). No guarantees about this utility are expressed or implied and no liabilty is assumed by Quantum Diagnostics Inc for any hardship or stress users may endure from its use. Your comments, questions, and suggestions are welcome. Version 1.1 status __________________ Supports a subset of HPGL. Current restrictions: Assumes HPGL is in "RS-232C" mode as opposed to "HP-IB" mode, i.e.: line-feeds are NOT interpreted as instruction terminators. Scientific notation in floating point arguments NOT supported. Escape operators are ignored and a message is displayed to inform the user each time one is encountered; typically this is harmless. HPGL operators not within the subset supported are ignored and a message is displayed to the user who may determine whether some action should be taken. Typically no action is necessary, and when action is needed it is probably easily accomplished in the AutoCad drawing editor. Current status of the HPGL subset is as follows: fully partially not yet no intention op supported supported supported to support -- --------- --------- --------- ------------ AA X AF X AH X AP X AR X AS X BL X CA X CC X CI X CM X CP X CS X CT X DC X DF X DI X DL X DP X DR X DS X DT X EA X EC X EP X ER X ES X EW X FP X FR X FS X FT X GP X IM X IN X IP X IV X IW X LB X LO X LT X NR X O* X PA X PB X PD X PG X PM X PR X PT X PU X RA X RO X RR X SA X SC X SG X SI X SL X SM X SP X SR X SS X TL X UC X UF X VS X WG X XT X YT X AutoCad features supported: Lines, Text, Arcs, Circles (we suggest defining MONOSPACE as the default font for text in your drawing as a start, then you can experiment with other text styles). The DXF file created is "entities only" and must be imported to an existing (possibly blank) drawing. Features are placed in the X-Y plane and all Z axis coordinates are forced to 0. Features are assigned to Layers by pen # (Layer name = Pen# - 1). LineTypes NOT supported (use pens and BYLAYER). To invoke the program use the following command line syntax at the DOS prompt: HPGL2DXF [d:][path]source[.ext] [[d:][path][dest[.ext]]] [/opt[ ][/opt]...] where "source" is the input file in ascii hpgl which is assumed to be in the current directory, on drive "d:" (if specified), or in directory "path" (if specified), and "dest" is the output file in ascii dxf format which will be written to the current directory, on drive "d:" (if specified), or in directroy "path" (if specified) named according to the conditions below, and configuration of scale and other attributes will conform to the option switches "/opt" contained on the command line consisting of a leading slash character followed by a code described below. Invoking HPGL2DXF without any arguments displays the syntax usage message. If source contains no extension and the file does not exist, hpgl2dxf will attempt to open a file of that name with the extension .PLT. If dest is not named, the file name of source will be used with the extension .DXF added. If dest is named but contains no extension, the .DXF extension will be added. To obtain an output file with no extension, put a dot after the file name on the command line (null extension). Valid option switches are: /p create polylines - this switch not yet supported /m sets the basic unit to be the millimeter (default is inch) /o file overwrite permission (without this switch, user will be prompted for permission if output file already exists) /e use HP 'emulate' switch setting criteria (not fully supported) /n# set plotter units per base unit (default = 1024 per inch, 40 per mm) /u# set user units per base unit for hpgl scaling instruction SC (default = 1) /f# set the precision of reals to # (0-8) digits following the decimal point. The default is 4. Omitting # causes variable length decimal fields in reals. /s set scepter configuration (scepter is a pcb design package marketed by Royal Digital Systems of San Jose CA. Version 3.xx of scepter has the bug of producing arcs of 89 degrees when they should be 90). Setting this switch forces all arcs of 89 degrees to 90 in the output file and sets user units to 1000 to the inch (equivalent to /u1000). /d defeat the exit message "#" following the switches /n and /u may be any decimal number and may contain a decimal point. The utility will maintain the accuracy of the number even though its report to the user console will round it to an integer. Option switches are read from left to right on the command line and a switch can override one which preceded it. For example, the switch sequence: /n400 /m yields millimeter base units at 40 plotter units per millimeter. To obtain 400 units per millimeter, use the sequence /m /n400. Example 2: /s /u1024 forces 89 degree arcs to 90 degrees and resets the user units to 1024. The following message appears upon successful termination of the program: If you find HPGL2DXF to be useful, a contribution toward the programming effort would be appreciated. The amount of the contribution should represent the value of the utility to you. We suggest something in the range of $5 to $50. Quantum Diagnostics Inc will register contributors. Registry offers the user access by telephone to the programmer to discuss bugs, proposed enhancements, implementation and operating philosophy, praise, complaints, hate mail, death threats, and other pertinent topics. Contributors of $45 or more will receive upon request, for a $6 materials and postage charge, the complete source code on diskette (5.25 or 3.5). Thank you. We at Quantum Diagnostics Inc bid you good bye and good weather. Quantum Diagnostics, Inc. 420 Apollo Ste C Brea, CA 92621 714-990-5020 - 30 - HPGL2DXF was written in C and compiled and linked with the Microsoft C Compiler version 5.1.