Hi,
I have an xml file that contains all details of entities to create a drawing. I want to first create a dxf file from this information. Is this possible?
Thanks
|
Hi,
I have an xml file that contains all details of entities to create a drawing. I want to first create a dxf file from this information. Is this possible?
Thanks
Possible? Yes. Easy? No. There isn't much documentation on the file structure. It would be easy to get the format wrong. Is there some reason you have to have dxf? I would just use the xml to create entities in a dwg. if you need dxf, you could always do SaveAs.
I think creating entities would also be fine. I will try to work on it and see.
You can use .net dxf library. It can create dxf files easily.
https://netdxf.codeplex.com/
By electing to write to DXF in lieu of DWG you're also relegating your capabilities, when you could instead simply use the same code base for this or other tasks by writing to DWG and simply exporting/saving to DXF.
Remember, the DWG you're appending entities to the Database of need not be named, but can even be a mere temporary file (before the resultant DXF is created), so the 'overhead' differential is negligible, yet enhanced functionality and entity support is available. Win-win.
Cheers
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
There may be an advantage to using ASCII DXF: an XSL transform could be applied to convert the XML to a DXF file without any type of AutoCAD involvement. I've done similar to convert XML data to HTML, CSV, and other ASCII formats. The stylesheet would be quite limited in what it could handle unless you don't mind it getting horribly complicated.