DXF Viewer: 2D CAD Viewer for Industrial Workflows
A focused desktop tool for opening and inspecting DXF files without installing a full CAD suite, built for engineers reviewing CNC jobs and manufacturing documentation.

DXF Viewer is a small desktop application for one job: opening a DXF file and looking at it properly. A full CAD suite is heavy and slow to launch when all someone needs is to verify a CNC job, inspect a layer, or review a drawing before it goes to the floor. This one opens a file, fits it to the window, and stays out of the way. It is written in Python on PyQt6, with ezdxf reading the file and a QPainter canvas of my own doing the drawing.
What it draws: LINE, CIRCLE, ARC, LWPOLYLINE, POLYLINE, SPLINE, ELLIPSE, POINT and TEXT from model space, antialiased.
- Arcs run counter-clockwise from start to end angle, in degrees as ezdxf stores them. The sweep comes from ezdxf's own span calculation, so an arc from 270 to 45 degrees draws the 135 degrees between them, not the other 225
- Splines are evaluated through ezdxf's B-spline construction tool as a 100-segment path, closed when the spline is closed, and the same points feed the zoom-to-fit bounds
- Ellipses are rebuilt from the major-axis vector and the axis ratio, then rotated into place
Colour and line style: An entity's own true colour wins, then its AutoCAD Color Index, with ByLayer and ByBlock resolving to the layer. White, including index 7, is drawn black on the light canvas. Four named linetypes map onto Qt pen styles; the rest draw solid.
Navigation: On open, the view is fitted to the extent of every entity with a 15% margin. The wheel zooms 10% a step around the cursor, so the point under the pointer stays put, clamped between half the fitted scale and ten times it. Dragging pans.
Everything goes through one transform with Y flipped, since drawing coordinates grow upward and screen coordinates downward. Text gets a second local flip so it is not mirrored, arc angles are negated because Qt measures them against a downward Y axis, and lines use a zero-width cosmetic pen that stays one pixel wide at any zoom.
Layers:
- A layer tree, sorted alphabetically, with a colour swatch and visibility checkbox per layer, plus Select All and Clear All
- Prev and Next step through the layers one at a time, showing only the current one
- Defpoints is left out of the tree and the counts
- A fill toggle shades shapes in their own colour at partial opacity, except on layer 0
- An info panel shows the file name, the layer count and the entities per type
Selection and editing: CTRL and drag draws a selection rectangle; each one drawn with CTRL held adds to the selection. A line, circle, arc or polyline is picked when one of its defining points falls inside. The right-click menu deletes or clears the selection, and with one entity selected it opens a properties dialog: layer and colour for any of them, endpoints for a line, centre and radius for a circle or arc, start and end angles for an arc.
Interface: English and Turkish, switched from the Language menu without a restart: the menu bar is rebuilt and a Qt signal tells the panel and canvas to relabel themselves. The choice is kept in settings.json. The repository includes an example drawing and documents a single-file PyInstaller build.
Limits:
- Block references (INSERT), MTEXT, DIMENSION and HATCH are not drawn
- There is no save: edits and deletions change the open session, not the file
- Accepting the properties dialog writes a true colour to the entity, so one coloured by index or layer can turn black unless a colour is picked
- Colour indexes beyond the first ten are approximated, not looked up in the 256-colour table
- Every entity is redrawn on every repaint, with no caching or culling for large files
Where it fits: Checking CNC jobs before they run and inspecting drawings on a shop-floor terminal: work that needs a viewer, not CAD authoring.

