DwgWriter: AutoCAD drops a 3DSOLID written with SAT data to DWG 2000-2010
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
Research direction
Read writeModelerGeometry and writeModelerGeometryData in DwgObjectWriter.Entities.cs, using #1150 and the attached failing and fixed DWG files as references. Compare the writer output with AutoCAD’s sample files and check the corresponding readModelerGeometry early return. Done means ACadSharp writes SAT solids that open in AutoCAD and can read its own output back correctly.
Written by the indexing model from the issue text.
Description
When a 3DSOLID with SAT data is written to a DWG 2000-2010 file, AutoCAD (TrueView 2025) asks to recover, reports "Modeling Operation Error: Error Code Number is 58000" and the solid is gone. The same SAT written to a DXF 2010 opens fine.
Compared with the files AutoCAD writes (samples/sample_AC1014.dwg to sample_AC1024.dwg), writeModelerGeometry differs in two places:
- It returns right after the SAT, so the record ends at the zero block size. AutoCAD goes on with the wireframe block (the Wireframe present bit and what follows) and, from R2007, the trailing BL.
- It writes the whole SAT as one block. AutoCAD splits it into 4096 byte blocks.
With only the first change AutoCAD still fails. With both, and the unknown bit set to 1 as AutoCAD does for SAT, the file opens and the solid is there. readModelerGeometry has the same early return, so ACadSharp reads its own files back without noticing.
#1150 writes the record this way (writeModelerGeometry and writeModelerGeometryData in DwgObjectWriter.Entities.cs), in case it helps as a reference.
Attached: box_AC1024_3.8.35.dwg, written with 3.8.35 (fails), and box_AC1024_fixed.dwg, the same document with the changes above (opens). The box SAT comes from samples/sample_AC1015.dwg.
- 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