Automation error while processing AutoCAD drawings from WPF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a .NET C# AutoCAD Plugin that converts the content of the dwg file or read some information from DWG and report. Multiple commands are exposed to perform these operations.
I automated this C# Plugin to be get called from a plain c# console application by loading AutoCAD automation object and sending the commands and it was working fine.
Now I created a WPF application and move the logic of console application to WPF and it was failing a lot of times. I have to add the code below before calling any of the AutoCAD commands
While (!GetACAD().GetAcadState().IsQuiescent)
Thread.Sleep(3000);
It improves the situation but not perfect and it still it fails on some drawing and then I rerun and it works fine.
For console this was never a problem.
Any idea or suggestion ?