Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
MicroStation
  • Product Communities
  • More
MicroStation
[Archived] AskInga Wiki Hewlett Packard Graphics Language 2
    • Sign in

    • -AskInga
      • +3D MicroStation
      • +AccuDraw Secrets
      • +Animation - Rendering
      • +Behind The Scenes
      • +Cells
      • +Colours
      • +Conversion - Translation
      • +Coordinate Input
      • +Design Settings
      • +Dimensions
      • +DWG
      • +EDG
      • +Element Manipulation
      • +Element Properties
      • +Element Selection
      • +Freeware - Shareware
      • +Interface Look And Feel
      • +Internet - E-Links - Links
      • +Keyins
      • +Levels
      • +Line Styles
      • +Models
      • +MSM Archive
      • +Other
      • +Presentations
      • -Printing - Plotting
        • A quick solution to plot transparent shapes in V7
        • A quick solution to plot transparent shapes in V8
        • Add levels to your PDFs
        • An awesome EMF plot driver
        • Changing printer.plt to metric
        • Configuring line weights in PRINTER.PLT
        • Controlling pen wdths with pen tables
        • Create plot shapes with this macro
        • Creating EMF and WMF files with MicroStation V8 XM Edition
        • Customized PDF plot drivers for Acrobat Distiller
        • Default plot scale
        • Edit the print driver to print to file
        • File naming conventions and pen table customization
        • Hewlett Packard Graphics Language 2
        • Hewlett-Packard print drivers
        • How to make a PDF of your design file
        • How to plot a file
        • Improve fonts in PDFs made from a design file
        • Masking text on plots
        • Open and edit files via a Batch Plot Job file
        • Open PDF automatically after creating them
        • Plotting rasters
        • Plotting to scale
        • Prevent editing of the printer driver configuration file
        • Print accounting variables
        • Printing grayscale to a laser printer
        • Show drawing plot scale in border
        • Show entire file name in border
        • Show model name in the border
        • Show the Windows username in border
        • The contents of a customized plot driver
        • Turn off the ability to plot levels
        • Using customization to automate batch plotting
        • Using the Batch Plot utility
        • White to black conversion when printing
      • +Programming - Automation
      • +Rasters - Images
      • +References
      • +Tags - Data Fields - Fields
      • +Text - Fonts - Annotation
      • +Views
      • +Windows - Interacting With
      • +Workspaces - Configuration
    • graffiti

     
     Questions about this article, topic, or product? Click here. 

    Hewlett Packard Graphics Language 2

    AskInga logo

    Original Article Date:  June 7, 2002

    Anthony Cox from Red Box Design shares this article with us. It was originally created as an internal document to address some specific plotting issues when dealing with HPGL/2 plotfiles and contains some terrific reference material. Thanks Anthony!!

    Anthony Cox from Red Box Design shares this article with us. It is based on an internal document that's part of their CAD Manual and address some specific plotting issues when dealing with HPGL/2 plotfiles. It's chalk full of terrific reference material and Anthony is willing to share the HTML version complete with illustrations upon request. Please contact him directly via email if you'd like a copy. His email address can be found at the bottom of the page. Thanks Anthony!!



    HPGL vs HPGL/2
    HPGL was developed by Hewlett Packard to drive its family of pen plotters. Most commands are vector oriented - pick up the pen, put down the pen, move here, move there. Very few complex commands are part of HPGL since the original plotters did not include powerful CPUs.

    HPGL/2 was developed as a successor to HPGL to support many more advanced features that could be off loaded to plotters with powerful CPU's and large amounts of memory. HPGL/2 also includes quite a lot of raster controls and commands since most modern plotters are actually raster devices. This includes embedded pen definitions - up to 256 since a raster device can never run out of pens..., fill patterns, screened vectors, clipping windows, data transformation and the like.

    Why do we use it?
    MicroStation allows us a great deal of flexibility on how the final print will appear by using an editable list of preferences found in a Plot Driver File. This file allows us to decide what happens to colours, line styles, pen weights and so forth.

    Three main advantages of using HPGL2:

    1. They are totally independent of any CAD program.
    2. They are difficult to alter - although they can be edited.
    3. They have the print size embedded in the file - making it difficult to plot out at the incorrect size.


    Before we can use this type of file we must understand the process in creating plotfiles.

    Creating Plot Files:
    Each time we press the Print button in MicroStation, and are using the correct plot driver file, we are sending HPGL2 information directly to the plotter.

    The creation of a plotfile is the recording of the information that is sent to the plotter and consists of three parts:

    • Header information - with information the plotter needs to create the plot.
    • Body Information - the actual pen up/down/move commands.
    • Footer Information also for the plotter, end of file, eject, cut.



    Typically the file will have the same name as the design file with the suffix of PLT instead of DGN.

    It is possible to look at this file in Notepad or WordPad, however larger plotfiles tend to crash Notepad. To create a plotfile we need to tell MicroStation to re-direct the output to a file rather than the plotting device. This is explained later. More often, you are likely to receive somebody else's plotfile, and so we need to understand how to send a plotfile to a printer/plotter.

    Sending the Plotfile to a Printer/Plotter:
    There are two way of sending the information to a plotter. The first way is to view the information using a program and then print it in the normal "Windows" fashion. Unfortunately, as soon as you do this, you negate all three of the advantages of using plotfiles.

    • You require more software to view the information.
    • It is possible to alter the "style" of the plot but not the content.
    • Most importantly you can choose the page output and perhaps get it wrong.
    • Even if the page size is correct, the way margins are handled may create an image out of scale.



    The second way is to send the information directly to the plotter by using a simple DOS command. This would allow us to avoid the operating system entirely but does require you to know the name of the printer, the name of the plotfile and the exact location of both.

    One of the most difficult things with this is determining the "Unique Naming Convention" path to the plotter. This is affected by how the plotter is linked to the computer holding the plotfile information.

    To Determine the "Unique Naming Convention" (UNC) path to the Plotter:
    To establish the "address" of the printer/plotter, we first need to understand how it is attached to your computer. There are three ways this can be done:

    • Via a direct parallel cable to the back of your computer.
    • Via the network to a special "Jet Direct Card" attached to the back of the plotter.
    • Via the network to a remote computer.



    If the plotter is connected directly to the back of your computer with a single cable, then your plotter is connected to a Local Port. Convention dictates the you have two of these:LPT1 and LPT2. The operating system automatically allocates LPT1 to the first device it finds which is in most cases your plotter.

    We can now define the UNC of the plotter in question as:

    LPT1

    To send a plot file using DOS you simply type the following:

    Type plotfile.plt>LPT1

    If LPT1 does not work, try LPT2.

    If the plotter is attached to a Direct Jet Card, then the solution for determining the UNC is unknown.

    If the plotter is attached to a remote computer, we need to know the name of that computer, and the name of the plotter. The name of the plotter can be determined from Windows by going to the Print dialog. In the following example, we are looking for the name of A0 roll fed Design Jet 488 Plotter.

    Depending upon the Windows operating system you are running, navigate to the Printers dialog that lists your printers. This dialog will also tell you the name of the computer that the plotter is connected to. In our shop, we see that HPDJ488 is connected on REDBOX01. The next thing to find out is the share name of the plotter. On most Windows systems, you should be able to simply highlight the plotter in the dialog and go to File > Properties. Then select the Sharing tab and you'll should be able to see the share name. For us it will be HPDJ488CA. Note that the name of the plotter can be entirely different than its share name.

    We can now define the UNC of the plotter in question as: \\REDBOX01\HPDJ488CA

    Since it's possible to place spaces in share names, it's always a good idea to enclose everything in quotation markers such as this: "\\REDBOX01\HPDJ488CA".

    (For additional information about share names and computer names with respect to your plotter, please refer to: / How to plot a file

    To send a plot file using DOS you then type the following:

    Type plotfile.plt>"\\REDBOX01\HPDJ488CA"

    Using and typing in long filenames in DOS can be rather difficult, and it's often better to create a simple batch file to automate the printing process.

    Create a Batch File to Automate the Printing Process:
    First we must override the default Windows settings for viewing files, so depending upon which Windows Operating System you have, navigate to either the View Options or Folder Options dialog and ensure that the following are set:

    • Show All Files
    • Display Full Path in Title Bar
    • Show File Extensions for Known File Types



    Decide on a generic name for the batch file - we call ours A0_Plotter.bat and A1_Plotter.bat

    Open either Notepad or Wordpad, create a new text file, and enter the following line (don't forget to subsutitue your *own* computor and plotter names): TYPE %1>"\\redbox01\HPDJ488CA"

    Note, you can also use the DOS command "COPY" instead of "TYPE" as shown. Save your file as AO_Plotter.bat and place a shortcut to the file on your Desktop.

    You now have a file that will allow you to "Drag and Drop" plotfiles. The only limitation is that you can only do one file at at time.

    Changing the Shortcut Icon:
    You will notice that the shortcut to your new file is a generic icon and it would be rather nice to change it to something of meaning. The HP logo is something most users are familiar with so we'll change the shortcut to use this highly recognized logo. Icon images are traditionally found in files with the extension of ICO and will be located somewhere on your HP Product Installation CD. You'll need to copy the ICO file containing the logo you want to the same location as your newly created batch file and rename it to something like HP.ICO.

    To alter the icon of the shortcut on your desktop, just do a Right-click > Properties and select Change Icon. You'll probably get a message saying the btch file contains no icons, which isn't a problem. Just click the OK and then the Browse button. Navigate to your folder and select the icon file. Your shortcut now has the icon associated with HP Products.

    "Send To" a Plotter:
    One nice function of Windows is the right click Send To option and by adding a shortcut to the batch file it is possible to select a file and "Send To" the plotter by just doing a right-click!

    Again, the following depends upon the version of Windows your running...but you need to get to navigate the to Send To folder for your Windows Profile. Once it's located, all you need to do is place a shortcut to the batch file in that folder. The shortcut will now be availalbe when you do a right-click on any file.

    Plot Files from MicroStation:
    As noted before, the way MicroStation translates the information from the screen to the plotter can be highly customised with the use of a plot driver file. Bentley has supplied a series of drivers for various plotters including HP plotters. This has led to some confusion since the majority of those are simply HPGL2 settings that can be applied to *any* HPGL2 device - including LaserJet 4MV printers.

    Contents of a MicroStation HPGL2 Plotfile:
    It's possible to examine a plotfile and obtain useful information from it - primarily the size of the plot. As noted earlier the plotfile has three parts:

    • Header - Information of use to the plotter.
    • Body - The actual Up/Down/Move commands.
    • Footer - Information for the plotter such as stop, eject, and cut.



    The following informationn are the typical commands found in an HPGL2 plotfile. The commands are normally separated by a semicolon and for clarity each command has been isolated onto a single line. Note that the actual graphical information has also been removed.

    %0BBP1
    Enters the HP-GL/2 mode, BP=Begin Plot

    "test.dgn"
    File name

    INPS33240,21328
    Initialise the plotter and establish the plot size, in plotter resolution units, as 33240,21328.

    QL100
    Quality Level = 100 which is the best setting.

    SC
    Scale

    NP64
    Number of Pens = 64

    TR0
    Tranpareny mode where 0 is Off and 1 is On.

    LA1,1,2,2,3,1.500000
    Unknown

    PW0.025000
    Pen Width in plotter resolution units = 0.025 mm

    PE
    Unknown

    PC0,255,255,255
    Pen Colour 0 = RGB Values of 255,255,255

    PC1,0,0,0 to PC63,200,0,0
    Remaining pens

    IW0,1072,33239,21327
    Input Window - possibly used for margins.

    PE
    Actual graphical information

    PUSP0
    Unknown

    PG
    Advance full page

    Determine the Page Size from a Plotfile:
    The most useful information that can be determined from a plot file is the page size. If you multiply the INPS values by the PW you get the size of the output in millimetres. 33240x0.025=831mm, 22400x0,.025=560mm which is an A1 sheet in landscape mode allowing for 10mm margins on the long side and 17mm margins on the short side.

    AskInga Article #104

    • Askinga
    • Article
    • Plotting Printing
    • Share
    • History
    • More
    • Cancel
    • CTennyson Created by Bentley Colleague CTennyson
    • When: Tue, May 27 2008 10:49 AM
    • Inga Morozoff Last revision by Bentley Colleague Inga Morozoff
    • When: Mon, Jun 14 2010 11:45 AM
    • Revisions: 5
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2022 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies