Database.Save e eFileInternalErr: bug di AutoCAD

19. dicembre 2007

In AutoCAD 2008 eseguendo il metodo managed ObjectARX:

Application.DocumentManager.MdiActiveDocument.Database.Save()

viene sollevata l'eccezione:

eFileInternalErr

ed il dwg non viene salvato.

Si tratta di un bug (l'ennesimo...) dell'API di AutoCAD.

Per aggirare il problema è sufficiente utilizzare il metodo SaveAs passando come nome del file il nome del dwg corrente:

Application.DocumentManager.MdiActiveDocument.Database.SaveAs

(Application.DocumentManager.MdiActiveDocument.Database.Filename, Autodesk.AutoCAD.DatabaseServices.DwgVersion.Current)

Oppure è possibile invocare il comando "_qsave".

E' veramente incredibile che un prodotto software di questo livello contenga dei bug di questo genere. 

[EDIT]

Grazie a Giuliano per questa segnalazione relativa alla documentazione:

"You can't save a database to the same file it was read from, because it may not have been completely read in initially, so saving to the same file poses the risk of concurrently reading/writing to the same file. The SAVE command uses saveAs() to save to a different (e.g., temporary) file and then either deletes or renames the original to *.bak, and then renames the saved file to the original filename. "

Resta valida la soluzione che propongo per salvare sullo stesso file.

AutoCAD e ObjectARX

Commenti (3) -

giuliano
22/10/2008 01:55:12 #
guarda che non è un bug... ;)

"You can't save a database to the same file it was read from, because it may not have been completely read in initially, so saving to the same file poses the risk of concurrently reading/writing to the same file. The SAVE command uses saveAs() to save to a different (e.g., temporary) file and then either deletes or renames the original to *.bak, and then renames the saved file to the original filename. "
30/11/2008 18:25:27 #
Grazie per la segnalazione!
Ho modificato il post
Ciao!
davide
13/07/2010 23:26:53 #
ciao a tutti volevo segnalare un errore sperando che qualcuno possa aiutarmi a risolvere un problema di autocad 2009, l'errore che mi da è questo : unhandled access violation writing 0xdbf2000 exception at 772f9b2bh
Ho cercato da per tutto ma non ho trovato soluzione chiedo il vostro aiuto grazie mille a tutti
Commenti chiusi