Latest change: Sat Apr 22 20:28:34 MEST 2000

If you came here by means of a search bot you'll probably like to start from the top and have a menu!

About this Page

This page gives a short overview what the DXF Viewer understands and what it does to the information found in the DXF file. The following information is given for version 1.04.


Short Reference

DXF

The DXF Viewer understands DXF as written by AutoCAD® Release 12 and earlier. The R12 DXF had become some sort of standard in the CAD world and -- besides AutoCAD® itself -- I haven't seen a program which writes DXF as defined by newer versions.

Since version 1.04.00 the viewer is capable of reading DXF as written by newer AutoCAD releases (i.e. R13, R14 and 2000) but does not support newer features and entities. Note that newer AutoCAD versions have a R12 backward compatibility mode when saving DXF.

The DXF Viewer is capable of reading the ASCII and the binary form of DXF files although the latter is not tested very well (because I own only three test files) and may be fragile.

DXF files may be packed with gzip or zip. When the Viewer discovers a zip archive it tries to load the first file from it.


DXF Entities

Here are all DXF entities and what the viewer does to them:

DXF Entity Viewer's idea of it Layer Color Line Style Line Width Extrusion
3DFACE Converted. Ok. Ok. n.a. n.a. Ok.
3DSOLID Ignored. This is new in R13/14 and is a container for proprietary data. Will never be supported. - - - - -
ARC Converted. Ok. Ok. Ok. n.a. Ok.
ATTRIB/ATTDEF Converted (considered beta). - - - - -
BLOCK Converted (except XREF) Ok. Ok. n.a. n.a. n.a.
BODY Ignored. This is new in R13/14 and is a container for proprietary data. Not yet supported. - - - - -
CIRCLE Converted. Ok. Ok. Ok. n.a. Ok.
DIMENSION Converted. Ok. Ok. n.a. n.a. n.a.
ELLIPSE(introduced in DXF13) Converted. Ok. Ok. Ok. n.a. Ok.
HATCH Ignored. This is new in R13/14 and probably will be supported in a coming version. - - - - -
IMAGE Ignored. This is new in R13/14 and it's not sure whether this will be supported in a coming version. - - - - -
INSERT Converted. Ok. Ok. n.a. n.a. n.a.
LEADER Ignored. This is new in R13/14 and probably will be supported in a coming version. - - - - -
LWPOLYLINE(introduced in DXF13) Converted. Ok. Ok. Ok. Only correct w/o extrusion. Ok.
LINE/3DLINE Converted. Ok. Ok. Ok. n.a. Ok.
MLINE Ignored. This is new in R13/14 and probably will be supported in a coming version. - - - - -
MTEXT Ignored. This is new in R13/14 and probably will be supported in a coming version. - - - - -
OLEFRAME Ignored. This is new in R13/14 and is a container for proprietary data. Will never be supported. - - - - -
OLE2FRAME Ignored. This is new in R13/14 and is a container for proprietary data. Will never be supported. - - - - -
POINT Converted (only to a dot). Ok. Ok. n.a. n.a. Ok.
POLYLINE Converted. Ok. Ok. Ok. Only correct w/o extrusion. Ok.
RAY Ignored. This is new in R13/14 and it's not sure whether it will be supported in a future version. - - - - -
REGION Ignored. This is new in R13/14 and is a container for proprietary data. Will never be supported. - - - - -
SHAPE Ignored. - - - - -
SOLID Converted. Ok. Ok. n.a. n.a. Ok.
TEXT Converted (with correct font, if known, otherwise with default font TXT).
Ignored in non-text version.
Ok. Ok. n.a. n.a. Ok.
TOLERANCE Ignored. This is new in R13/14 and probably will be supported in a coming version. - - - - -
TRACE Converted. Ok. Ok. n.a. n.a. Ok.
VIEWPORT Ignored. - - - - -
SPLINE Ignored. This is new in R13/14 and probably will be supported in a coming version. - - - - -
n.a. = not applicable

As can be seen in the table the entities introduced with AutoCAD R13/14 are mostly not supported yet.


Common Properties for Application and Applet

There are some properties which are understood by the viewer whether it is run as an application or an applet. In an application you set them with the -D command line switch, in an applet it's just another parameter.

Property/parameter name Property/parameter value type Default value Purpose
modeldraw.reducelines Integer number 2000 The number of lines drawn in reduced mode.
ltype.use boolean value true Whether line type information should be used (true; slows down drawing) or not (false).
ltype.maxrepetitions integer number 500 Only used if ltype.use=true. Defines the maximum number of repetitions of an ltype when it's fitted to a line. If the actual number of necessary repetitions is higher the line is drawn continuously. A value of 0 or less is interpreted as infinity.


Application Properties

The Application form of the DXF Viewer understands the following properties (set them with the -D command line switch):

Property name Property value type Default value Purpose
dxfview.language ISO language code en Set the startup language of the viewer. The default language is english, so the only value which makes sense is de_DE which turns on German.
preview.reducelines integer number 2000 The number of lines drawn in the Postscript print preview dialog window.
print.monochrome boolean value false Whether standard printing is done monochrome (true) or colored (false).


Applet parameters

The Applet form of the DXF Viewer understands the following special parameters (you may use the common properties as applet parameters, too!):

Parameter Name Parameter Value Type Default Purpose
file URL none DXF file to be shown in the viewer
language ISO language code en_US The language for messages and labels. Only en and de are supported.
framed boolean false Start the viewer in an extra window with menu bar etc.?
frameWidth int 800 Width of viewer window (only used when framed=true)
frameHeight int 600 Height of viewer window (only used when framed=true)
withStatusBar boolean true Shows a status bar if true
withControls boolean true Shows controls for view and layer manpulation if true
swapBW boolean false Swap black & white?


LiveConnect

The Applet supports some LiveConnect® features (calling of applet methods from JavaScript) now, the most nifty is the possibility to load another file. Here's the javadoc:

loadFile

public void loadFile(java.lang.String url)
Load a file into the viewer. This method is thought to be used from JavaScript via LiveConnect.
Parameters:
url - file's URL, may be relativ to document base

getNumberOfLayers

public int getNumberOfLayers()
Return the number of layers shown.
Returns:
number of used layers

getLayerName

public java.lang.String getLayerName(int index)
Return the layer name for the given index. The maximum index is one less than the number of layers returned by getNumberOfLayers(). This method is thought to be used from JavaScript via LiveConnect.
Parameters:
index - the index of the layer name (0 <= index < NrOfLayers)
Returns:
layer name or null if the given index is out of bounds

isLayerIndexVisible

public boolean isLayerIndexVisible(int index)
Is the layer with the given index visible? This method is thought to be used from JavaScript via LiveConnect.
Parameters:
index - layer index
Returns:
is this layer visible? (always false if index is out of bounds)

isLayerVisible

public boolean isLayerVisible(java.lang.String name)
Is the layer with the given name visible? This method is thought to be used from JavaScript via LiveConnect.
Parameters:
name - layer name
Returns:
is the layer visible? (always false if there's no layer with the given name)

setLayerIndexVisible

public void setLayerIndexVisible(int index,
                                 boolean visible)
Set the layer with the given index visible or invisible. This method is thought to be used from JavaScript via LiveConnect.
Parameters:
index - layer index (nothing happens if index is out of bounds)
visible - set layer visible if true, otherwise invisible

setLayerVisible

public void setLayerVisible(java.lang.String name,
                            boolean visible)
Set the layer with the given name visible or invisible. This method is thought to be used from JavaScript via LiveConnect.
Parameters:
name - layer name (nothing happens if there's no such layer)
visible - set layer visible if true, otherwise invisible

showLayerIndex

public void showLayerIndex(int index)
Show the layer with the given index. This method is thought to be used from JavaScript via LiveConnect.
Parameters:
index - layer index (nothing happens if index is out of bounds)

hideLayerIndex

public void hideLayerIndex(int index)
Hide the layer with the given index. This method is thought to be used from JavaScript via LiveConnect.
Parameters:
index - layer index (nothing happens if index is out of bounds)

showLayer

public void showLayer(java.lang.String name)
Show the layer with the given name. This method is thought to be used from JavaScript via LiveConnect.
Parameters:
name - layer name (nothing happens there's no such layer)

hideLayer

public void hideLayer(java.lang.String name)
Hide the layer with the given name. This method is thought to be used from JavaScript via LiveConnect.
Parameters:
name - layer name (nothing happens there's no such layer)

resetView

public void resetView()
Reset the model view to the initial state. This method is thought to be used from JavaScript via LiveConnect.

resetViewXY

public void resetViewXY()
Reset the model view to a xy view. This method is thought to be used from JavaScript via LiveConnect.

resetViewYZ

public void resetViewYZ()
Reset the model view to a yz view. This method is thought to be used from JavaScript via LiveConnect.

resetViewXZ

public void resetViewXZ()
Reset the model view to a xz view. This method is thought to be used from JavaScript via LiveConnect.

showPreviousView

public void showPreviousView()
Go backward in the view stack. Does nothing if this is an initial view. This method is thought to be used from JavaScript via LiveConnect.

showNextView

public void showNextView()
Go forward in the view stack. Does nothing if this is the last view. This method is thought to be used from JavaScript via LiveConnect.