views:

1127

answers:

5

Anyone got a good and preferably cheap and easy way to do this? The closest I got was to save a file to .SVG and use Inkscape to convert it to XAML. All lines and such converted nicely, but all the text was just a pile of text on top of the document. I also tried importing the DXF to Adobe Illustrator and using Mike Swansons AI to XAML export plugin, but that didn't work on my files. I just says something like "unable to save".

UPDATE:

I've tested Visio, I was unable to make it read a single DXF file. Eventually I downloaded AutoCAD LT, made a drawing with 2 lines, a box and some text. Saved it to all available formats and tried to import all files into Visio. No go. I really wonder how Visio can claim it supports DXF files.

I've tested 3D PaintBrush, and as I suspected it only worked on 3D models. My drawings are simple 2D drawings with some lines, boxes, paths and some text.

I feel quite sure Zam 3D will also only import 3D objects, but I am going to test it (even if I think I have tried it earlier).

Most of the links to conversion tools are outdated, and the few that remains are 3D tools. I was able to convert a PDF document today, but that also just exported the text as paths and not text objects (which I really need).

I also looked into BAML (Binary Xaml), and it seems that the support for creating and working with BAML will be quite good in .Net 4, as it is pratically non-existing in 3.5. But I suppose that if I manage to convert the files propely they will be small enough to handle as XAML files (the ones I've tried now converts to 3.5 mb and loads really slowly).

+1  A: 

If you have Microsoft Visio you might be able to use VisioExportToXAML. I know Visio can import DXF but I haven't tried the tool to convert to XAML.

This page lists some other WPF tools, including ZAM 3D which is mentioned specifically as being able to convert DXF to XAML. This post on the same blogs mentions some more (but the links seem to be broken just now).

Kevin ORourke
A: 

The Open Design Alliance .Net API has an AutoCAD - SVG export function too. Firefox renders SVG (apparently). I haven't tried it but it might be 1 way to get an AutoCAD drawing into the browser. Let us know how you go.

DXF compatibility shifts with versioning. AutoDesk probably reversion DXF as often as they do DWG.

CAD bloke
+1  A: 

Right .. A new followup. I really had to sort this out, because we needed technical drawings from AutoCAD displayed on webpages using Silverlight.

The most succesfull try I had earlier was by using Illustator and Mike Swansons export plugin. I tried this solution again and I now have a full 100% successrate with the conversions. I don't know if it's because I'm using the newest Adobe Illustrator, updates to the export Plugin or the fact that I'm using different drawings than before; but it works.

So, in short:

  • Download and save export plugin to Adobe Illustrator plugin folder
  • Open AutoCAD drawing using Adobe Illustrator CS5
  • Export to xaml using Mike Swansons excellent tool link text

Hey presto, the xaml can be dynamically downloaded and displayed with a silverlight application.

sindre j
+1  A: 

CadLib provides AutoCAD DWG/DXF file to XAML conversion. It also can render to WPF paths programatically or render to GDI+ or OpenGL.

  • Wout
Wout