Latest change of this page: Saturday, 28-Aug-2010 18:26:09 CEST
This page introduces the first preview of the new version 2.00 of a Viewer for DXF files. Being a preview means that not everything is as perfect as could possibly be. An older and possibly more stable predecessor may be found on the quincunx DXF Viewer pages.
The DXF viewer is a Java program which displays DXF and SHX files. It runs under every machine which supports at least Java 1.4.
DXF is a file format which was introduced a long time ago by AutoDesk to work as an exchange format for their well-known AutoCAD program. SHX is the font format used by AutoCAD;.
The viewer reads 2D and 3D ASCII and binary DXF files (which may even be packed with zip, gzip and bzip2, but you should prefer zip), and understands a noticable subset of the features of newer DXF versions. If you have ever tried other DXF viewers you have probably noticed that there are many problems with newer DXF files. Blame AutoDesk because they added lots of stuff when switching from AutoCAD R12 to AutoCAD R13, partly incompatible and even some parts which are written in a completely different format which is embedded in the DXF file in an encrypted form. There are many additions which are useless for any programs other than AutoCAD resulting in unnecessary file bloat.
The files are displayed as wireframe graphics similar to AutoCAD. A rendered Java3D version like the one from where the shuttle image displayed on top of this page was taken is currently implemented, but not yet publically available.
Several output formats are supported.
An Applet version of the viewer is also available.
This is a preview release so please don't expect too much. There are still lots of useful features missing, but at least it is expected that the program runs quite stable. If you have DXF files which create errors feel free to send them to the author. Please pack the files to save bandwith (DXF packs very well).
The standard version of the viewer displays the files similar to the standard AutoCAD view. It runs as an application under every operation system with a Java 1.4 runtime environment or better.
The DXF Viewer in the form of the jar package as downloadable above may be used and distributed freely. This is beta software! Use it on your own risk!
Under most operation systems you can run the program from your GUI just like any other program (eg. double-clicking on it's symbol on Windows). There is one drawback with this approach, though, because by this the viewer may not use more than 64 MBytes of memory which is not enough for really big files.
If you often run into memory problems you may want to increase the amount of memory the viewer is allowed to use. Read on to learn more.
There is a memory usage indicator in the status bar which shows you how many memory the viewer has allocated and how much of it it is using. If this indicator gets dark red the viewer's memory is nearly exhausted which will slow down performance dramatically.
Getting a error box displaying "java.lang.OutOfMemory" is the fatal sign. There's not enough memory available for the operation you are currently running (probably loading a file).
If you have several files open you can close some of them to free memory. The newly freed memory does not show directly in the memory indicator, but it will after the next garbage collection is run. Garbage collection is done automatically so you don't have to care.
There are more than one way to allow for more memory. The one which is working on all platforms is to start the viewer with a script, i.e. a .cmd file on Windows or a shell script on Unix. It has to contain just one line:
java -mx256m -jar dxfviewer-swing.jar
Here 256m stands for the amount of memory allowed to the viewer (in this case 256 MByte). I'd recommend not to use more than 3/4 of the total amount of physical memory in your machine.
The following are two example scripts which you may enhance to your needs. Both start the viewer with a maximum amount of 256 MBytes whic should be enough in most cases. Just store them in the same directory as the jar file. Depending on your browser's settings it may be necessary to right-click and select "Save as" to get them stored.
Standard Java installations have only a rudimentary support for image formats. After installing the Java Advanced Imaging Image I/O Tools from the Java Advanced Imaging API you'll find some more output formats in the Save As menu. Just follow the installation instructions and install it as a Java extension.
Here's a table on which DXF entities are supported by the viewer:
| DXF ENTITY | Support Status | Comments |
|---|---|---|
| 3DFACE | supported | |
| 3DSOLID | ignored | Encrypted entity introduced in AutoCAD R13 |
| ARC | supported | |
| ATTDEF/ATTRIB | supported | |
| BODY | ignored | Encrypted entity introduced in AutoCAD R13 |
| BLOCK | supported | external (XREF) blocks are not yet supported |
| CIRCLE | supported | |
| DIMENSION | supported | |
| ELLIPSE | supported | introduced in AutoCAD R13 |
| HATCH | supported | introduced in AutoCAD R13 AutoCAD 2000 has notorious problems with hatches, and is known to create files with broken hatches, which may look bad in the viewer (and in newer AutoCAD releases). |
| HELIX | ignored | introduced in AutoCAD 2007 |
| IMAGE | ignored | introduced in AutoCAD R13 |
| INSERT | supported | |
| LEADER | supported | introduced in AutoCAD R13 |
| LINE | supported | |
| LWPOLYLINE | supported | introduced in AutoCAD R13 |
| MLINE | ignored | introduced in AutoCAD R13 |
| MTEXT | supported | introduced in AutoCAD R13 fonts may be substituted if not available columns and background coloring are not yet supported |
| OLEFRAME | ignored | introduced in AutoCAD R13 |
| OLEFRAME2 | ignored | introduced in AutoCAD R13 |
| POINT | supported | only as dot |
| POLYLINE | supported | |
| RAY | ignored | introduced in AutoCAD R13 |
| REGION | ignored | Encrypted entity introduced in AutoCAD R13 |
| SECTION | ignored | introduced in AutoCAD 2007 |
| RTEXT | ignored | introduced in AutoCAD R13 |
| SHAPE | ignored | |
| SOLID | supported | |
| SPLINE | supported | introduced in AutoCAD R13 |
| SUN | ignored | introduced in AutoCAD 2007 |
| SURFACE | ignored | introduced in AutoCAD 2007 |
| TABLE | ignored | introduced in AutoCAD 2006 |
| TEXT | supported | fonts may be substituted if not available |
| TOLERANCE | ignored | introduced in AutoCAD R13 |
| TRACE | supported | |
| UNDERLAY | ignored | introduced in AutoCAD 2006 |
| VIEWPORT | ignored | |
| WIPEOUT | ignored | introduced in AutoCAD R13 |
| XLINE | ignored | introduced in AutoCAD R13 |
The short version:
Although the viewer can read various packed formats, you should pack your
files with zip.
Somewhat longer:
I ran some tests and measured the overhead
needed to unpack the files during the read process, and it seems that
for gzip-packed files the standard library uses an algorithm
implemented in Java, while for files packed with zip a faster
local library implementation is used (the special package which is used for unpacking
bzip2 files is implemented in Java). Because jar files are
nothing else than zip files with some special content having
a fast unzip algorithm in the standard library is something definitely
needed, because it is to fear that a Java implementation would be a lot slower.
More than most people probably want to know:
Here's a PDF which shows the results of my tests.
My name is Rammi and I'm working as a freelancer. I'm living in the city Braunschweig in Germany.
If you can provide problematic DXF files, have questions, suggestions, or similar please click on the following link to send an eMail:
If you send DXF files please pack them prior to sending to save bandwidth.
I'm cooperating with Wout de Zeeuw who has written a
3D DXF Viewer and
library for .NET based on C#.
Click on the screenshot to see it full size.
We have a friendly competition running who is providing the better DXF Viewer.
The nice thing about this is that everybody is winning in this competition: we from our mutual feedback
and you from the improvements.
The viewer makes use of the bzip2.jar extracted from the Apache Ant project by Kohsuke Kawaguchi. Thanks a lot!
The viewer uses the FileDrop class from Robert Harder. Thanks to him!
Lots of people helped with feedback, ideas and test data. Special thanks go to
This product includes software developed by the Apache Software Foundation (http://www.apache.org/).
The DXF Viewer uses bzip2.jar extracted by Kohsuke Kawaguchi from the Apache Ant project to read files packed with the bzip2 algorithm.
Ant is distributed under the Apache Software License, Version 1.1:
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 2000 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Ant" and "Apache Software Foundation" must not be used to
endorse or promote products derived from this software without prior
written permission. For written permission, please contact
apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see http://www.apache.org/.
Java is a registered trademark of Sun Microsystems, Inc.
AutoCAD is a registered trademark of AutoDesk, Inc.
Windows is a registered trademark of Microsoft, Inc.
All other registered trademarks are the property of their respective owners.
Feature/bugfix release.
Bugfix release thanks to Enrico Gallo:
Corrected bug in bigfont support where bigfonts were wronly mapped.
Fixed several problems with text placement, especially for texts beginning or ending with spaces.
Improved bigfont support.
Fixed bug when text was not displayed if one of the used font was broken.
Fixed minor problems with text placement.
Improve MTEXT and font support.
MTEXT was much enhanced in recent AutoCAD versions which appeared after the first support for MTEXT was added to the viewer. This release closes the GAP by supporting paragraph formats, tabulators and stacked text.
Furthermore the viewer will now try to locate and load TrueType fonts on the machine even if they are not supported by Java itself.
A Java internal bug meant that TrueType fonts were not always displayed in the correct size. This version tries to work around this bug.
Fixed a bug were static attributes (ATTDEF) were always displayed regardless of their visibility status.
Added Brasilian Portugese resources provided by Paulo Henrique de Medeiros. Thanks a lot!
not released.
Improved picking support. Picking is now enabled by default (i. e. on new installations). If you are updating you may enable picking via the View tab in the Settings dialog (found in the Options menu).
Minor improvements when opening and saving files by adding file filters to restrict the choices.
This fixes a minor hatching bug.
This is mainly a bugfix release. The following issues are targeted:
This fixes an error where texts were not displayed when the font location settings were empty.
I'm currently very busy with other things, but I discovered that using
picking with Java 1.6 resulted in an IllegalArgumentException, so I fixed
that at least. Picking is not enabled by default because it uses more
memory.
Hopefully in about two months I'll have some time again
to make more useful additions.
This also adds a switch to revert the reaction to mouse wheel rotation because somehow on Windows things usually get bigger when you turn the wheel away from you, while on Unix it's the other way round. To my feeling the Windows way is counter-intuitive, because I feel that when I drag something to me it shall become bigger, and smaller when I push it away (but it seems like Windows users seem to sit on their mouse). However: now you decide for yourself, while I can still have the "correct" feeling on both systems. Sorry that it only works after a restart, but I'm really much to busy for implementing this more smoothly (which was the reason I hesitated to release this earier although I wrote the code nearly half a year ago on a user request).
Fixed a problem which kept settings in the print settings dialog from having a effect.
Fixes a bug introduced in version 2.00p71 which kept horizontal and vertical lines from being drawn.
Another bugfix release which adds slightly improvements in performance.
This release mainly addresses a problem when running the viewer with the upcoming Java 1.6 release which resulted in NoSuchMethods exceptions thrown in the conversion step of several (but not all) files. This is fixed now.
A bugfix and feature release.
On very rare occasions a POLYLINE was displaced completely. This is fixed.
In order to find the bug I had to implement picking (so I could pick on the incorrectly placed POLYLINE and see where it came from), and as a result the viewer now does allow picking, too. Because picking requires that the whole file is kept in memory it is switched off by default (so the viewer needs less memory). Please enable it in the view settings. It will not work at once (because the file is no longer available in memory) but for all files you load after that.
Another bugfix release:
Lines with a linetype scaling of zero were not displayed in former releases, but they are now.
Another bugfix release:
The viewer didn't like binary DXF written by recent AutoCAD versions. Binary DXF is a rarely used variety of DXF, which is usually in text format.
This is a bugfix release:
Fixed problem with cached fonts not found.
Added internal debugging support.
Try to run with Java property debug.show.window set to true (i.e. -Ddebug.show.window=true).
This incorporates improvements for printing and PDF/Postscript save useful when handling bigger files. Printing and saving is done in a background thread and does no longer block the GUI.
Fixes -- once again (sigh) -- the bug which removed the history buttons from the 2d view toolbar.
Fixes the bug which removed the history buttons from the 2d view toolbar.
Fixes some problems which memory which is not released when a model view is closed.
Small changes:
Various minor improvements and a little bit of brush up for the new load mode introduced in p59.
Fixed i18n exception not allowing PDF and PostScript export.
Changed loading code so it's easier to load multiple files into one model. This will still need a little brush up.
Optimization is difficult. On some files reading became very slow as a result of the optimizations introduced in the previous version. This is fixed now.
This release adds a lot of improvements for drawing of large files. The achieved speed enhancements depend on the data contained in the DXF file, and they are mostly useful if the data contains lots of texts in TrueTypeFonts (TTF).
Usually the viewer draws TTF texts anti-aliased because they are better readable this way. But on some architectures anti-aliasing takes a lot of time. So now there's a possibility to switch off anti-aliasing but it's probably not necessary because there are some other optimizations which have a better effect. Here's some results from a 30 MByte DXF with 30000 texts (mostly TTF) and where info reports 1.1 million lines. The times are stopped on a Athlon XP 1600+ under Linux with an awful X setup which makes anti-aliasing very slow as you can easily notice.
| Anti-Aliasing | min. Text Height | Redraw Time/s |
|---|---|---|
| ON | 0 | 31 |
| off | 0 | 9.1 |
| ON | 2 | 1.8 |
| off | 2 | 1.8 |
When zooming into the model there is another optimization running in the background which does clipping of larger objects before they are dropped in the internal drawing routine which speds up drawing of the file used for the tests above (where it was always drawn completely) 5fold (from somewhat above 4.0 to 0.8 seconds).
Another improvement is for the reduced mode used during movements (eg rotation, panning, zooming). The reduced mode used until the previous version (now called static reduce mode) just draws every nth line. This gives useful results for standard files, but with large files something like every 100th line is drawn, which is good for an overview but does not leave much to be seen when zoomed deep into the model.
Now there's another reduced drawing mode called (guess what) dynamic reduce mode which tries to adapt to the number of objects really displayed.
You can set the reduce mode and other settings in the settings dialog.
Fixed problem with zoom indication rectangle missing in 3D view.
Another major reduce of jar file size by using proguard and by removing some duplicate entries introduced by ant's jar task:
| Previous size: | 1,465,802 Bytes |
|---|---|
| Current size: | 896,509 Bytes |
| Difference (gain): | 569,293 Bytes |
I used the time between Xmas and New Year's Eve to rearrange everything internally into clearly defined modules. For a mere user the only recognizable change is slightly reduced size of the jar file.
Fixed problem with too many spline fit points created.
Fixed problems which sometimes resulted in NullPointerExceptions.
Fixed ugly flickering during load.
Also added new versions of the starter scripts dv.cmd and dv.sh with special options which are helping the viewer loading files faster.
Added reduced drawing during mouse wheel usages.
Exchanged previous output routines for PS, PDF and SVG with optimized ones with improved speed and less memory footprint.
Fixed positioning of DIMENSION if it is offset in z direction.
Fixed NPE when codepage is undefined, and IllegalPathStateError on HATCH w/o boundary definition.
Fixed problem with unavailable codepage ANSI_869 when running Java 5 under Windows.
Enhanced AutoCAD 2004/2006 compatibility.
Fixes a problem with ARC entities where the start angle is the same as the end angle.
Cosmetic changes.
Fixes a class cast exception when adding a 3D file to a 2D view.
This release introduces some minor performance optimizations and fixes the following bugs:
This release only incorporates an internally refactoring needed for another project.
Added Recent Files feature.
Fixed bug resulting in sometimes incorrect HATCH placement.
Fixed bug resulting in sometimes incorrect 2D POLYLINE placement.
Fixed resource exceptions in PS/PDF output dialogs.
Added mnemonics and accelerators.
Fixed infinite loop with buggy DXF files.
Fixed memory problem with lines with too many dashes.
Fixed problem with underlined text in 3D view.
Added the possibility to always use the middle mouse button for panning which comes quite handy if ypu want to measure angles in the 2D view.
Added some bells and whistles for 2D rotation.
Fixed problem which resulted in line drawn to upper left corner of view window in rare circumstances.
Improved printing and vector format output by allowing floating point coordinates for these tasks.
Minor bug fixes.
Minor bug fixes.
Added rotation for 2D files.
Fixed various line type problems.
More drawing optimizations.
This release fixes a bug where the viewer allocates more and more memory on each redraw which occured in rare circumstances introduced in version 2.00p17 (not publically released).
This release adds support for the LEADER entity, fixed a problem with rotated MTEXT and includes first steps on improved drawing routines (15% faster).
This release fixes some problems with the placement of the model in PostScript and PDF export.
This was the first official preview. It was released on July 6, 2005, to celebrate the European Parliament's decision against software patents.