Free Downloads

Contact | Sitemap | Search

Pltin - Read HPGL (type 1 ASCII) plot files back into autocad.

pltin11.zip - download source code (unix and Windows)
pltin11r14.zip - download binary for autocad R14 on WindowsNT/95

What is pltin

Pltin is a modification of the program hpgl2scr by William D. Palmer. The original read in a HPGL I text file and created an autocad script file from it. This script would then, when loaded into autocad, draw lots of lines to represent the original plot.

I modified this program and linked it with the ADS library, so it can be loaded into autocad and executed there. It now creates polylines, inserting them directly into the autocad database, and it recognizes pen numbers, which are translated to seperate layers.

I applied some other changes and the program now acts as a well behaved program is expected to, checking the files for existence and acessability. After this it seemed to work fine with R12 on a SunOS 4.x and Solaris.
The new version 1.1 now runs smoothly with autocad R14 on WindowsNT/95 (though I have only tested it on NT 4.0sp3).

pltin makes tests on the input file to check if really an HPGL I text file. The first characters of the file must be either "^[." (for any HPGL escape sequence) or "IN;" (for "INITIALIZE") which I consider the most likely to appear at the beginning of a HPGL plotfile. If they don't, we're busted, as well as when they do in a file of any other type (the program will exit with an error message later during processing).
This was one of my first programming excersizes in C back then, so please don't look too close at the programming style ...

I have made some bug fixes while porting it to NT, such as closing the input file again after checking its content, and more detailed error messages. Other enhancements are the use of a dialog for selecting the file and popup messages for errors.


Download either the binary for your platform if available or the sources, which you then need to compile. On most unix systems this is done with the following command (paths may be different):

 cc -o pltin -I/usr/acad/ads pltin.c /usr/acad/ads/ads.a -lm 

The sources contain a project directory for MS VC++ 5.0 in the unlikely case you wish to build your own windows binary. You will need to modify a few search paths in the project options to point to the adsrx library and include directories.

There will usually be a windows binary of the current version available for download, as the ability to compile code is not as widespread with windows users as among unix cracks.

Copy the application file pltin(.ads) [pltin.arx for R14] to a location on your system's hard disk that Autocad searches from its "acadprefix" system variable The Autocad system variable "acadprefix" is automatically set from the "ACAD" environment variable on startup. Please refer to your systems user manual of your specific operating system platform to find out about how to set environment variables. In Autocad R14 the search paths are usually set up in the preferences dialog.

Type (xload "pltin") [(arxload "pltin") in R14] at the Autocad "Command:" prompt to load the application. You can also put this statement into your "acad.lsp" file to load pltin automatically at startup, or you can put the line (autoxload "pltin" '("pltin")) into the file "acadr12.lsp" if you are running Autocad R12, or "acadr13.lsp" if you are running R13. This will load pltin automatically the first time one of its commands is entered the first time in a drawing session. In R14 the easiest way to load an extension application is with the help of the appload dialog.


pltin gives you one new command:

The new version 1.1 uses the standard file open dialog for selecting the input file.
After that you are prompted for a:
The name you enter is used as common prefix for the layers created to draw the polylines on. The complete layer names are then composed of this prefix, an underscore and the pen number found in the hpgl file. If the required layers don't yet exist, they are created.


The filename extension "*.plt" doesn't say anything about the type of file you have. If you plot from Autocad, every file will be named "somefile.plt", no matter what plotter driver you select or what plotter type you plot to. This program pltin processes only HPGL (type 1 ASCII) plot files, which were traditionally used for HP pen plotters. It does a simple check to see if the file contains HPGL 1 data and refuses processing it its expectations aren't met.

Here is the list of plotter types Autocad R12 (Solaris) supports for plotting out of the box:

  1. None
  2. ADI plotter or printer
  3. AutoCAD file output formats
  4. CalComp ColorMaster Plotters
  5. CalComp DrawingMaster Plotters
  6. CalComp Electrostatic Plotters
  7. CalComp Pen Plotters
  8. Canon Laser Printer
  9. Epson LQ2550 24 pin
  10. Hewlett-Packard (HP-GL)
  11. Hewlett-Packard (HP-GL/2)
  12. Hewlett-Packard (PCL) LaserJet
  13. Hewlett-Packard (PCL) PaintJet XL
  14. Houston Instrument
  15. IBM 7300 Series
  16. PostScript device
  17. Raster file export

From this list, only type 10 can be imported again by pltin. This list is actually only a subset of the theoretically available plot file formats, so don't be surprised if pltin refuses to process your file (Postscript is at least recognized and named).

Please note in particular, that HPGL-2 is a binary format and has therefore very little in common with HPGL-1. So even if you know you have a HPGL file, it may still not work...


There are proably many ... tell me if you find them!


I expect the program to be more or less self explanatory for users who have basic experience with Autocad. If there are still questions that cannot be answered neither through the manuals and FAQs to Autocad, nor by your local guru, you might try to contact me through the link below.

Georg Mischler


(Please don't ask me, how William D. Palmer wants to release hpgl2scr into the public domain and still keep the copyright... but that's not something I feel like worrying about)


  This program copyright © 1991 by William D. Palmer, 1313
  Vickers Ave. Durham, NC  27707.  The program is released into
  the public domain, and any commercial use without the prior
  written consent of the copyright holder is prohibited.
  No warranty as to the suitability of this software for any
  particular purpose is expressed or implied.

  pltin 1.0, Copyright © 1992 Georg Mischler
  pltin 1.1, Copyright © 1998 Georg Mischler

  Permission to use,  copy,  modify,  and distribute this software
  for any purpose and without fee is hereby granted, provided that
  the above  copyright  notices appear in all copies and that both
  the  copyright notices and this  permission notice appear in all
  supporting documentation.
  This permission is restricted by the copyright notice by William
  D. Palmer for hpgl2scr above where applicable.

Copyright © 2004-2020 schorsch.com