DwgReader leaves the value of a table block cell as a default CadValue
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
Research direction
Start in DwgObjectReader.Entities.cs at readTableCellContent, specifically the TableCellContentType.Block case; compare its handling with the DXF cell value described in the issue. The repository samples sample_AC1032.dwg and sample_AC1032_ascii.dxf reproduce the discrepancy, including cells at row 1, column 3 and column 4. Done means block-cell values read from DWG are empty rather than unknown values with data, matching the DXF result.
Written by the indexing model from the issue text.
Description
When a table cell contains a block, DwgReader reads the block record handle of the cell content and leaves CellContent.CadValue as it was created: ValueType Unknown, Flags 0, so IsEmpty is false. AutoCAD stores the value of the same cells as an empty string.
How to reproduce, with the samples in the repository (the DXF was saved by AutoCAD from the same drawing):
CadDocument dwg = DwgReader.Read("samples/sample_AC1032.dwg");
CadDocument dxf = DxfReader.Read("samples/sample_AC1032_ascii.dxf");
CadValue fromDwg = dwg.GetCadObject<TableEntity>(0xA35).Rows[1].Cells[3].Content.CadValue;
CadValue fromDxf = dxf.GetCadObject<TableEntity>(0xA35).Rows[1].Cells[3].Content.CadValue;
| ValueType | Flags | IsEmpty | Value | |
|---|---|---|---|---|
sample_AC1032.dwg |
Unknown | 0 | false | null |
sample_AC1032_ascii.dxf |
String | 1 | true | null |
Cell 4 of the same row gives the same result, and so do sample_AC1024.dwg and sample_AC1027.dwg. In the DXF, AutoCAD writes the value of both cells as 301 CELL_VALUE, 93 1, 90 4, 94 0, 300, 302, 304 ACVALUE_END.
The difference comes from readTableCellContent in DwgObjectReader.Entities.cs: the TableCellContentType.Block case reads only the handle and never sets the value.
Expected: the value of a block cell is read as empty, as in the file saved by AutoCAD, so that it is not taken for a value with data.
I found this while testing the CadValue writer in #1263: the DXF round trip writes these cells back as unknown values with data.
- 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 5 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