Monthly Archives: October 2008

Flex/Flash AutoCAD DWG/DXF Viewer

CADViewer

I put this together as a proof of concept. It can render DWG files up to, and including, AutoCAD 2009. DXF files are also supported.

The demo is limited to a file upload size of 250kb.

Flash’s rendering capability puts an upper limit on the complexity of the drawing. A DWG file close to the 250kb limit will likely render slowly and cause response to be sluggish. The rendering engine is fully capable of rendering large files provided the client computer can support it.

I temporarily embedded Arial as the default font. You can see on a few of the holes in the initial drawing that the diameter symbol has been replaced by another character. I need to track down a proper CAD font to use in the viewer.

A number of the CAD files I looked at required fractional font sizes. I solved this by setting font size using Math.floor and setting scaleX/scaleY to account for the remainder. I am planning to port this feature over to the SVG Viewer as time allows.

Flex SVG Viewer – RGB Patch & Matrix Fix

NotFFirk contributed a patch providing RGB color support.

Example:

Om brought a matrix calculation bug to my attention.
The x/y coordinates were not being added to the tx/ty coordinates in the SVG transform matrix.
This should now be fixed.

[Subversion Repo]
svn co https://iciifs.com/svn/SvgViewer SvgViewer

http://code.google.com/p/svg-viewer/