Generated DWG displays as black screen until AutoCAD Command is run
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the issue with the C# example in the report, which writes a DWG using DwgWriter, then inspect how the writer handles the drawing view or extents. Compare the freshly generated file with the same file after running Zoom Extents in AutoCAD. Done means the drawing is visible and the coordinates respond normally on opening, without running that command.
Written by the indexing model from the issue text.
Description
Describe the bug
When generating a DWG File, the file generated is displayed as a black screen in AutoCAD. The coordinates in AutoCAD do not change when moving the mouse.
When I run zoom extents in AutoCAD, the correct image and blocks display. It displays properly at this point.
PAPERSPACE
To Reproduce
BlockRecord result = new("Test BlockRecord");
result.Entities.Add(new Circle() {Center = new(5, 5, 0)});
result.Entities.Add(new TextEntity() {Value = "Test Text"});
CadDocument doc = new();
doc.BlockRecords.Add(result);
Insert insert = new(result);
insert.InsertPoint = new(20, 20, 0);
doc.BlockRecords[BlockRecord.PaperSpaceName].Entities.Add(insert);
using (var file = File.Create(@$"{yourFileDirectory}\TestText.dwg"))
using (var dwgWriter = new DwgWriter(file, doc))
{
dwgWriter.OnNotification += (o, args) => Debug.WriteLine(args.Message);
dwgWriter.Write();
}
Expected behavior
Generated frontsheet should not need AutoCAD command, Zoom Extents, to run to have a dwg be displayed.
Screenshots
Freshly generated (3.4.29)
Freshly generated (3.6.12)
After zoom extents
Additional context
Bug first appeared after migrating from 3.4.24 to 3.4.29.
Everything displays properly after zoom extents command.
On freshly generated DWG, coordinates in AutoCAD remain 0,0,0 no matter where mouse is moved. After command run, the coordinates change. Not sure how helpful this information is.
Release needed
- 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
- 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