ACadSharp
ACadSharp copied to clipboard
Error converting from DWG to DXF
I'm trying to convert a DWG to DXF. But the file saved is corrupted.
public static void Main(string[] args) {
var path = Ui.Prompt("Enter path to dwg file: ");
CadDocument doc = DwgReader.Read(path);
doc.Header.Version = ACadVersion.AC1018;
var dxfPath = Ui.Prompt("Enter path to dxf file: ");
using (DxfWriter writer = new DxfWriter(dxfPath, doc,false))
{
writer.OnNotification += NotificationHelper.LogConsoleNotification;
writer.Write();
}
}
Exception text in AutoCad When reading from HATCH, starting at line 3152, it was found the following error:
Error: Group code 47 expected Corrupt or incomplete input DXF file - drawing import failed.
Text in NotificationHelper
Entity type not implemented : ACadSharp.Entities.Wipeout
Object not implemented : ACadSharp.Objects.SortEntitiesTable
Object not implemented : ACadSharp.Objects.SortEntitiesTable
Object not implemented : ACadSharp.Objects.SortEntitiesTable
Object not implemented : ACadSharp.Objects.SortEntitiesTable
Object not implemented : ACadSharp.Objects.SortEntitiesTable
Object not implemented : ACadSharp.Objects.AcdbPlaceHolder
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Object not implemented : ACadSharp.Objects.Scale
Hi @ShadowGreg,
The type of the Hatch that you are trying to convert seems to be using the flooding method, which uses the variable PixelSize from the Hatch, that is not written at the moment.
I'll open a branch to fix this issue, could you provide the Dwg that you are trying to convert? or a copy of it with only the Hatch that is making if fail? it will help with the implementation.
Thanks!
Your file seems to have characters in the Text and MText that the writer cannot process correctly, I'll create another branch to take a look at this second issue.
PR that fixed the text format for Tolerance and MText but the dxf file produced by ACadSharp is still invalid in this particular case.
- https://github.com/DomCR/ACadSharp/pull/253