DxfWriter: ACDSDATA schemas differ from the ones AutoCAD writes
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 51/100
Research direction
Start by reproducing the mismatch with the provided C# snippet, then compare the ACDSDATA section of the generated out.dxf with samples/sample_AC1032_ascii.dxf. Trace CreateDataStorage() and CadFileDataStorage to see how schemas are built, and inspect writeAcdsSchemaRecord and the DXF schema reader for the reported lost property codes. Done when the writer preserves AutoCAD’s schema properties and embedded records, and the round trip handles them as described.
Written by the indexing model from the issue text.
Description
Hi @DomCR,
Thanks for 3.8.35. We moved to it today and the SOLID3D problem from #1342 is gone.
While checking 3DSOLID round trips we noticed that the schemas DxfWriter writes in the ACDSDATA section are not the same as the ones AutoCAD writes. It can be reproduced with the samples in the repo:
CadDocument doc = DwgReader.Read("samples/sample_AC1032.dwg");
DxfWriter.Write("out.dxf", doc, false);
Then compare the ACDSDATA section of out.dxf with samples/sample_AC1032_ascii.dxf, written by AutoCAD. With 3.8.35:
AcDb_Thumbnail_Schemahas a third property,AcDbDs::TreatedAsObjectData(280 1, 91 1). AutoCAD writes onlyAcDbDs::IDandThumbnail_Data, and putsTreatedAsObjectDatain an embedded record.AcDbDs::HandleAttributeSchemais written with 280 1 / 91 0. AutoCAD writes 280 7 / 91 1 / 284 1.AcDb_Thumbnail_SchemaandAcDb3DSolid_ASM_Datahave no embedded records. AutoCAD writes four in each (101 ACDSRECORD):TreatedAsObjectData,Legacy,AcDs:IndexableandHandleAttribute.- The schemas read from the file are not used:
CreateDataStorage()always builds the six fixed schemas ofCadFileDataStorage, sowriteAcdsSchemaRecord, which throwsNotImplementedException, is never reached.
The first schema, AutoCAD on the left and DxfWriter on the right:
ACDSSCHEMA ACDSSCHEMA
90 0 90 0
1 AcDb_Thumbnail_Schema 1 AcDb_Thumbnail_Schema
2 AcDbDs::ID 2 AcDbDs::ID
280 10 280 10
91 8 91 8
2 Thumbnail_Data 2 Thumbnail_Data
280 15 280 15
91 0 91 0
101 ACDSRECORD 2 AcDbDs::TreatedAsObjectData
95 0 280 1
90 2 91 1
2 AcDbDs::TreatedAsObjectData
280 1
291 1
(3 more embedded records)
A side note: when reading a DXF, consecutive schema properties get merged (Thumbnail_Data ends up inside AcDbDs::ID), and the 1, 282 and 284 codes are lost.
- Dominant language
- C#
- Stars
- 873
- Forks
- 223
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 28
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DomCR/ACadSharp
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
DWG writer: text styles get the text-style table as their xref block handlePossibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
DwgWriter writes a null shape-file handle for SHAPE entities (WriteShapes = true)Possibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
DwgReader reads a color-book entity's Color as ByBlock instead of the book's colorPossibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
Similar issues
-
hand-to-AI
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug python
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
Maintainers usually reply within 13 days