Latest change: Sat Apr 22 20:28:34 MEST 2000
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.
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.
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.
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. |
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). |
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? |
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:
public void loadFile(java.lang.String url)
url - file's URL, may be relativ to document basepublic int getNumberOfLayers()
public java.lang.String getLayerName(int index)
getNumberOfLayers().
This method is thought to be used from JavaScript via LiveConnect.index - the index of the layer name (0 <= index < NrOfLayers)public boolean isLayerIndexVisible(int index)
index - layer indexfalse if index is out of bounds)public boolean isLayerVisible(java.lang.String name)
name - layer namefalse if there's no layer with the given name)
public void setLayerIndexVisible(int index,
boolean visible)
index - layer index (nothing happens if index is out of bounds)visible - set layer visible if true, otherwise invisible
public void setLayerVisible(java.lang.String name,
boolean visible)
name - layer name (nothing happens if there's no such layer)visible - set layer visible if true, otherwise invisiblepublic void showLayerIndex(int index)
index - layer index (nothing happens if index is out of bounds)public void hideLayerIndex(int index)
index - layer index (nothing happens if index is out of bounds)public void showLayer(java.lang.String name)
name - layer name (nothing happens there's no such layer)public void hideLayer(java.lang.String name)
name - layer name (nothing happens there's no such layer)public void resetView()
public void resetViewXY()
public void resetViewYZ()
public void resetViewXZ()
public void showPreviousView()
public void showNextView()