Drawing require recovery

Open
#1,404 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with the DWG header template decoding path that validates the MEASUREMENT value, then inspect how AC1032 headers are read and compare the supplied drawing with a valid file. Reproduce the reported invalid value 256 and identify where it originates before changing parsing behavior. Done means the drawing opens without recovery in ACadSharp and existing DWG parsing behavior remains covered.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
On open the produced file required recovering

To Reproduce
Open the file

Drawing1_labelled (1).zip

Expected behavior

Screenshots

Additional context
Here is a bug report from OpenCadStudio, the same recovery happens in AutoCAD but without a detailed log

Open CAD Studio drawing recovery report
Report schema: 2
Report ID: R2-1794921983-2512df80a35d
Application version: 2026.45
Application build: 2026.45
Application revision: fb0a667e269b
Build profile: release
Build features: none
Reader version: 0.6.8
Reader revision: eababc0
Platform: windows/x86_64
Created (Unix seconds): 1794921983
File: drawing-2512df80a35d.dwg
Size: 15052 bytes
Source SHA-256: 2512df80a35d1f5d855c6a4edee21183a5a96599a785190bceef129a88aa5212
Result: opened with a recovery report

Summary
Format: DWG
Format version: AC1032
Maintenance version: 228
Recovery mode: true
Stream completed: true
Source sections: 2
Observed source records: 162
Successfully decoded source records: 145
Known skipped source records: 0
Output entities: 13
Output objects: 83
Output table records: 41
Entities scanned: 13
Parser errors recovered: 2
References checked: 0
References loaded: 0
References recovered: 0
References unavailable: 0
References failed: 0
References skipped: 0
Save as new file required: yes

Timing
Parse: 2 ms
Validation: 0 ms
References: 0 ms
Scene caches: 0 ms
Geometry prep: 2 ms
Total: 53 ms

Diagnostics
[Warning] Reading DWG file version: AC1032 (AC24)
[Warning] AC18 inner header: page_map_address=0x39E0, section_map_id=14
[Warning] AC18: Read 15 page records from page map
[Warning] AC18: Read 12 section descriptors from section map
[Error] Invalid file format: Invalid MEASUREMENT value: 256
[Error] Initial read failed; recovery mode continued: Invalid file format: Invalid MEASUREMENT value: 256

Structured reader diagnostics
[code=template-decode-failed stage=header section=AcDb:Template offset=- offset-basis=- line=- handle=- type=-] Invalid file format: Invalid MEASUREMENT value: 256
[code=strict-read-failed stage=record-stream section=- offset=- offset-basis=- line=- handle=- type=-] Invalid file format: Invalid MEASUREMENT value: 256

The source file was not modified by this operation.
Save the repaired drawing as a new file before continuing work.


Release needed
3.8.35

  • Yes, using the Nuget package.
  • No, using the github repo.
Dominant language
C#
Stars
873
Forks
223
Avg merge
1d 15h
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DomCR/ACadSharp

All issues in DomCR/ACadSharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.