Some of you might have tried using ADS functions like ads_entget() on in-memory drawings opened as side databases using AcDbDatabase::readDwgFile() and find that it returns NULL for some drawings and correct values for others. So is it safe to use ads functions on in-memory drawings opened as a side database?
The short answer is “no”. In recent versions of AutoCAD (from AutoCAD 2000 and up), ADS functions assume you are working with the current document's database. This is different from earlier versions where ADS functions only work with the drawing currently loaded in the AutoCAD editor. The subtlety here is that the “current” document is not necessarily the same as the document of the drawing visible in the editor.
The result (of this change in AutoCAD 2000 and up) is that for recent versions of AutoCAD, some ADS functions might work with objects in side databases in some circumstances, but that is not by design.Therefore, you should not rely on of ADS for side databases.
If you want to work on objects in side databases you'll need to use non-ads functions such as the methods in the various AcDb classes.