PHP Classes

PHP DXF Create: Generate CAD files in the AutoCAD DXF format

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 51%Total: 1,222 All time: 3,120 This week: 524Up
Version License PHP version Categories
dxf-writer 0.1GNU General Publi...4.0Graphics


This class can generate CAD files in the AutoCAD DXF format.

It can add different types of vectorial graphics elements to the composition of a drawing like lines, circles and text.

The class supports multiple layers, each with its own color and line type. Each element may be added to a distinct layer.

The composed drawing generated in AutoCAD DXF format and returned as a string or served as file for download.

Innovation Award
PHP Programming Innovation award nominee
March 2013
Number 4
DXF is a well known file format used by applications like AutoCAD to export and import vectorial graphics drawings.

This class can create drawings and export them in the DXF format.

Manuel Lemos
Picture of Alessandro Vernassa (speleoalex)
Name: Alessandro Vernassa ... is available for providing paid consulting. Contact Alessandro Vernassa ... .
Classes: 3 packages by
Country: Italy Italy
Age: 45
All time rank: 106240 in Italy Italy
Week rank: 249 Up10 in Italy Italy Up
Innovation award
Innovation award
Nominee: 3x

Winner: 1x


 * @author Alessandro Vernassa
<!DOCTYPE html>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>DXF Writer</title>
        $shape = new DXF();
        $shape->addLayer("mylayer", DXF_COLOR_RED);
        $shape->addLayer("text", DXF_COLOR_BLUE);
        $shape->addText(12, 110, 0, "HELLO WORLD", 5, "text");
        $shape->addCircle(50, 100, 0, 50, "mylayer");
        $shape->addLine(0, 100, 0, 100, 100, 0, "mylayer");
        <a href="?download">download dxf</a><br />
= new DXF();
$shape->addLayer("mylayer", DXF_COLOR_RED);
$shape->addLayer("text", DXF_COLOR_BLUE);
$shape->addText(12, 110, 0, "HELLO WORLD", 5, "text");
$shape->addCircle(50, 100, 0, 50, "mylayer");
$shape->addLine(0, 100, 0, 100, 100, 0, "mylayer");
        if (isset(
$dxfstring = $shape->getString();
"<h2>dxf string:</h2><pre>$dxfstring</pre>";

  Files folder image Files  
File Role Description
Plain text file dxfwriter.php Class DXF class source
Accessible without login Plain text file example.php Example example

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:3,120
This week:524Up
User Ratings User Comments (1)
 All time