Database.UpdateExt() Exception

Database.UpdateExt() Exception

MattKincaid
Advocate Advocate
1,149 Views
11 Replies
Message 1 of 12

Database.UpdateExt() Exception

MattKincaid
Advocate
Advocate

For a particular DWG file, I'm getting a System.AccessViolationException when calling Database.UpdateExt(False).  Interestingly, if I change to UpdateExt(True), no exception occurs.  Oddly, Try...Catch doesn't seem to catch the exception with UpdateExt(False).

 

Any ideas about what the problem is?  The DWG file seems pretty basic (2D, with reasonable extents). 

 

Thanks!

0 Likes
1,150 Views
11 Replies
Replies (11)
Message 2 of 12

moogalm
Autodesk Support
Autodesk Support

Hi,

 

Can you please share the drawing?

Does it have custom entities ?

 

0 Likes
Message 3 of 12

Anonymous
Not applicable

You can download the DWG from the link below.

 

https://lightinganalysts.sharefile.com/d/s323ec0f1c184e04a

 

I didn't create the file, so I'm not sure whether there are custom entities or not.  Thanks! 

0 Likes
Message 4 of 12

Alexander.Rivilis
Mentor
Mentor

This dwg-file have many errors:

Command: _AUDIT
Fix any errors detected? [Yes/No] <N>: _y
Auditing Header
Auditing Tables
Auditing Entities Pass 1
Pass 1 400     objects audited
Invalid anonymous block "*U77311" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-0".
Pass 1 600     objects audited
Invalid anonymous block "*U77412" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-1".
Pass 1 700     objects audited
Invalid anonymous block "*U77513" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-2".
Pass 1 1000    objects audited
Invalid anonymous block "*U78720" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-3".
Pass 1 1200    objects audited
Invalid anonymous block "*U78922" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-4".
Pass 1 1300    objects audited
Invalid anonymous block "*U79023" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-5".
Pass 1 1400    objects audited
Invalid anonymous block "*U79326" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-6".
Pass 1 1600    objects audited
Invalid anonymous block "*U79528" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-7".
Invalid anonymous block "*U79629" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-8".
Invalid anonymous block "*U79730" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-9".
Pass 1 1700    objects audited
Invalid anonymous block "*U79831" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-10".
Invalid anonymous block "*U79932" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-11".
Invalid anonymous block "*U80838" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-12".
Pass 1 1800    objects audited
Invalid anonymous block "*U81141" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-13".
Pass 1 2000    objects audited
Invalid anonymous block "*U81242" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-14".
Pass 1 2100    objects audited
Invalid anonymous block "*U81343" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-15".
Pass 1 2200    objects audited
Invalid anonymous block "*U81444" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-16".
Pass 1 2400    objects audited
Invalid anonymous block "*U81747" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-17".
Pass 1 2600    objects audited
Invalid anonymous block "*U81848" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-18".
Invalid anonymous block "*U82151" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-19".
Pass 1 6900    objects audited
Invalid anonymous block "*U915145" found in Block symbol table.
  Changed to normal block "AUDIT_I_200326171218-20".
Pass 1 12300   objects audited
Auditing Entities Pass 2
Pass 2 12300   objects audited
Auditing Blocks
 337     Blocks audited
Auditing AcDsRecords
Total errors found 21 fixed 21
Erased 0 objects

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 5 of 12

moogalm
Autodesk Support
Autodesk Support

Thanks Alex, do the problem resolves after recovering the drawing?

0 Likes
Message 6 of 12

Alexander.Rivilis
Mentor
Mentor

I've not problem both original and recovered dwg-file with AutoCAD 2020.1.2

Sample code:

static void ADSKMyGroupMyCommand() {
  // Put your command code here
  acdbCurDwg()->updateExt(false);
  acdbCurDwg()->updateExt(true);
}

 dwg

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 7 of 12

MattKincaid
Advocate
Advocate

Thanks for looking into it.  I had tried Audit as well, but fixing the file errors does not solve the problem for me. 

 

I just realized I'm using an older version of acdmmgd.dll (v 22.0.50.0.0).  Perhaps updating will fix for me?  I'll give it a shot and send an update with my results.

0 Likes
Message 8 of 12

Alexander.Rivilis
Mentor
Mentor

@MattKincaid wrote:

Thanks for looking into it.  I had tried Audit as well, but fixing the file errors does not solve the problem for me. 

 

I just realized I'm using an older version of acdmmgd.dll (v 22.0.50.0.0).  Perhaps updating will fix for me?  I'll give it a shot and send an update with my results.


Your question was posted to wrong forum as far as you do not use ObjectARX, but use AutoCAD .NET API. I did not checked with AutoCAD .NET API, but you have to use acdbmgd.dll from AutoCAD.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 9 of 12

MattKincaid
Advocate
Advocate

@Alexander.RivilisI'm using RealDWG 2018 to develop a stand alone application. 

 

My understanding was that RealDWG and ObjectARX were the same thing, and that AutoCAD .NET API was for coding AutoCAD addins.  Is that understanding not correct?

0 Likes
Message 10 of 12

Alexander.Rivilis
Mentor
Mentor

@MattKincaid wrote:

@Alexander.RivilisI'm using RealDWG 2018 to develop a stand alone application. 

 

My understanding was that RealDWG and ObjectARX were the same thing, and that AutoCAD .NET API was for coding AutoCAD addins.  Is that understanding not correct?


RealDWG also has native C++ and managed .NET libraries. AutoCAD .NET API and RealDWG .NET API are closer together than ObjectARX and AutoCAD .NET API. ObjectARX != RealDWG

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 11 of 12

MattKincaid
Advocate
Advocate

@Alexander.RivilisAh.  Could you please advise which forum is most appropriate?

0 Likes
Message 12 of 12

Alexander.Rivilis
Mentor
Mentor

@MattKincaid wrote:

@Alexander.RivilisAh.  Could you please advise which forum is most appropriate?


https://forums.autodesk.com/t5/net/bd-p/152

P.S.: But you have to specify that you use not AutoCAD .NET API but RealDWG (.NET)

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes