Latest change of this page: Tuesday, 11-Dec-2012 12:59:00 CET

de·caff DXF Viewer Version 2.00:
Cheat Codes

The behavior of the viewer can be tweaked by setting special properties. Many of these properties are thought for debugging, they eg enable experimental features or additional output. So in general usage of this cheat codes is not encouraged, but as they may be useful in some special situations, you can find an overview here.

A cheat code is defined by a name-value pair, and a default when this pair is not defined. For the viewer the cheat codes are set via Java properties, so to set it you have to call the viewer in a special way, so it is recommended to setup a start script for that:

java -Dname=value -mx1700m -jar dxfviewer-swing.jar

This sets a property named name to value. You may add more properties in the same way. The -mx1700m also allows the viewer to make use of 1700 MBytes of memory, which is near the maximum for 32-bit environments.

Many of the properties are also available in the applet, where they can be set as applet parameters:

<param name="name" value="value"/>

General Cheat Codes

NameValue TypeDefaultDescription
drawset.clip.limit integer 8 Internal limit of the lines contained in a draw set before a clip short cut is used. This limit will influence drawing speed when there are a lot of VIEWPORTs or the model is drawn when zoomed in. As it is a heuristic value it depends on the model whether changing this value in either direction is an improvement or not.
drawtext.clip.limit integer 8 Internal limit of the lines contained in the characters of a draw text before a clip short cut is used. This limit will influence drawing speed when there are a lot of VIEWPORTs or the model is drawn when zoomed in. As it is a heuristic value it depends on the model whether changing this value in either direction is an improvement or not.
dxf.config.dir directory user-home/.dxfviewer2 The directory where cached information is stored. If set to empty string caching is switched off.
dxf.excluded.entities string with entity types, separated by , Allows to exclude entities from conversion and display. Eg LINE,ARC will exclude all LINE and ARC entities.
dxf.spline.segments integer value 20 Minimal number of straight segments to be created between spline knots when approximating splines.
dxf.spline.precision small floating point number 0.1 Relative error allowed when approximating splines with polylines.
dxf.tabbed.always_3d boolean false If true 2D models will get 3D controls.
polygon3d.filled boolean false If true entities which are converted to polygons are drawn filled. Only usefull for 2D models, 3D display will appear cluttered.
ltype.maxrepetitions integer 2000 Maximum number of repititions of a ltype pattern before ltype fitting is skipped and the line is drawn continuously. Only used if ltype.use is true;
ltype.use boolean true If true the LTYPE information of DXF files is used. Switching this off may result in a huge performance boost for files using LTYPEs in a way that a lot of segments are created. See also ltype.maxrepetitions.
obey.extent boolean false If true the model is clipped to the extent defined in the DXF header.
preview.reducelines integer 20000 Maximum number of lines used in print previews.
print.monochrome boolean false If true printing is using only black color.
print.strokewidth floating point number 0.3 Line width for printing in 1/72".
print.twice.workaround boolean true If true a workaround for printing is invoked, which does print everything in a way that the print progress can be shown.
print.model.unit length If this parameter is given printing is done with a fix scale. Overworking the printing is high on the todo list, but for the time until that is finished you can use this parameter to enforce scaled printing. Just define the paper length to which one unit in the file shall print. If a valid non-zero value for this parameter is given, all printing is done with a fix scaling, centering the current view center on the paper. A length is defined by a number and a unit, so 1mm or 1in are examples for possible values of this parameter. The following units are also understood:
mmeter
dmdecimeter
cmcentimeter
mmmillimeter
kmmeter
ininch
ftfoot
ydyard
ptcomputer printer point, i.e. 1/72"
ppAnglo-Saxon pica printer point, i.e. 1/72.27000072"
The statistics page of a file gives information of its size, in case you don't have an idea of the unit. As using a different size means restarting the viewer with a different value of this parameter I agree this is a bad workaround for general cases, but it may still be handy in special ones.
printer.point.size length 1pt Size of one printer point used for fix scale printing. This should be 1pt, i.e. exactly 1/72". But at least my Kyocera printer seems to use pica points, which makes things come out some 0.4% too small. To work around this use a value of 1pp instead. Various units like mm (millimeter) and in (inch) are recognized.
Here is a file which I'm using for testing, which defines a grid of 170 to 250 units, which should fit nicely on a A4 page when the print.model.unit parameter is set to 1mm: Download or drag this link to the DXF Viewer window.
Print out and use a ruler to check. Please note that 0.4% deviation means not even half a mm for 10cm.
show.text.bg boolean true If true the background of MTEXT entities is displayed when they define one.
svg.side.length positive integer 1000 Virtual size of SVG files created when saving as SVG.
spatial.showHatchBorders boolean false If true HATCH borders are displayed.
view.pick.dragmin positive integer 2147483647 Minimal number of pixel before picking is using a selection rectangle.
view.zoomin.alpha integer between 0 and 255 128 Color alpha value of the zoomin drag rectangle. Lower values will make the rectangle more transparent, higher values will make it more intransparent.
view.zoom.dragmin positive integer 10 Minimal number of pixel the mouse has to move before zooming happens in zoom-in or zoom-out state.
use.custom.cursors boolean true If true customer cursors are used for some actions, otherwise only standard cursors are used.
wide.line.fill boolean false If true wide POLYLINEs are filled. This may be useful for 2D models, but might clutter 3D display.

Cheat Codes for Debugging

NameValue TypeDefaultDescription
debug boolean false If true an additional Debug menu is shown, allowing access to various debug features.
debug.layouts boolean false If true layout borders are shown, and a PAPERSPACE layout is always created.
debug.mask string consisting of some the following characters (not case-sensitive): TSWEFLA   There are various debug levels. A level is initially switched on (i.e. the messages for this level are propagated) if the character indicating this level is given here. The debug window can be used to switch levels on and off, too. The possible characters correspond to the levels as follows:
CharacterDebuglevelDescription
T Trace messages Trace messages are the lowest level of debug messages. As they may appear very often putting them out may slow down the program severely.
S Standard debug messages Standard messages are the next level. Usually issued more seldom than trace messages they may appear often enough to still slow down the program noticeably.
W Warning messages Warning messages are issued in situations when there is something going wrong, but in a way that the program can go on without greater problems. They should not appear often.
E Error messages Error messages are usually issued when there was an internal error, which could only be recovered from by returning to a defined state, eg when a file couldn't be read the viewer does stop loading the file, and shows an error dialog.
F Fatal error message A fatal error is one from which the program cannot recover, the only possibility is to stop the program. So a fatal error message is usually the last message you are seeing.
L Log message Log messages are outside of the hierarchy of the above messages (going from Trace to Fatal). The viewer usually does make use of them in very special debugging situation.
A Assert failures Assert failures are issued when an internal assertion is failing.
debug.print.console boolean false If true prints all debugging information to the console. The debug.mask should be set to something useful, otherwise nothing is printed.
debug.show.window boolean< false If true displays an additional window which allows access to various debugging information, see also debug (which allows to show this window via menu), debug.print.console, and debug.mask.
debug.tree boolean false If true another tab which displays a tree of the model created from the DXF file is added to the right tab pane.
dxf.read.all=true will provide more information about the file and its entities.
See also debug.dxf.tree, which is way to have a look at the underlying file.
dxf.read.all boolean false If true everything in the DXF file is read. This will slow down reading, and is only useful to get more information while picking or viewing the entity tree.
i18n.action.debug boolean false If true i18n action information is outputted with debug level message, so debug.mask has to be set to allow message level output, and a debugging channel (either debug.print.console or debug.show.window has to be opened.
sat.output boolean false If true the SAT file information of SAT based entities is output to the console.
spline.showControlPoly boolean false If true control polygons of SPLINEs are displayed.
stats.layer boolean false If true a per-layer statistics is created and added to the statistics page.
stats.linelen boolean false If true information about the accumulated line length of a model is included in the statistics page.