Author Topic: Why Teigha find errors every time for the same DWG?  (Read 2819 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Why Teigha find errors every time for the same DWG?
« on: January 29, 2015, 02:08:40 AM »
Teigha 4.0.1 .Net Classic x64

Simple code for attached dwg file:

Code - C#: [Select]
  1. #if TEIGHA_CLASSIC
  2. using Db = Teigha.DatabaseServices;
  3. using Rt = Teigha.Runtime;
  4. #endif
  5. ...
  6. private static void Run() {
  7.  
  8.   using (Rt.Services srv = new Rt.Services()) {
  9.     using (Db.Database db = new Db.Database(false, true)) {
  10.       String fileName = @"D:\data\123.dwg";
  11.       db.ReadDwgFile(fileName, Db.FileOpenMode.OpenForReadAndWriteNoShare,
  12.         true, null, false);
  13.  
  14.       Db.AuditInfo ai = new Db.AuditInfo();
  15.       ai.FixErrors = true; // Errors must be fixed
  16.       db.Audit(ai);
  17.       db.SaveAs(fileName, Db.DwgVersion.AC1021);
  18.  
  19.       // Output: Total errors found: 54, fixed: 54.
  20.       Console.WriteLine("Total errors found: {0}, fixed: {1}.",
  21.         ai.NumErrors, ai.NumFixes);
  22.     }
  23.   }
  24.   Console.WriteLine("Press any key for exit...");
  25.   Console.ReadKey();
  26. }

Pay attention on second comment (output) in my code, please. I get this result (found 54, fixed 54) every time (for the same resaved DWG file even), but AutoCAD 2015 find nothing. It happens not for this DWG file only but for many other. Why Teigha find errors every time for the same DWG?

Thank you.
« Last Edit: January 29, 2015, 03:32:55 AM by Andrey Bushman »

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
Re: Why Teigha find errors every time for the same DWG?
« Reply #1 on: February 10, 2015, 11:27:20 PM »
Can you determine what specific errors Teigha thinks it found are?
It might just be their libraries reporting something they don't recognize.
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Why Teigha find errors every time for the same DWG?
« Reply #2 on: February 11, 2015, 12:00:51 AM »
works if I change to DwgVersion = current. maybe something to do with saving down?

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: Why Teigha find errors every time for the same DWG?
« Reply #3 on: February 11, 2015, 02:33:48 AM »
ODA answer:
Quote
It seems bug was fixed with #14984 in current version ( rev. 159148 & 159168 - end of January ).
But I see on the downloading page (the member downloads data): Teighaź ... posted 12/15/2014.
I don't know when I can expect the ODA Member Downloads will updated... The ODA technical support doesn't quickly answer.
« Last Edit: February 11, 2015, 02:42:57 AM by Andrey Bushman »