The meaning of WorkingDatabase is application defined and so will depend on the host. MdiActiveDocument may or may not exist and may mean something entirely different if the host is not Autocad. Same goes for DocumentManager and Application. If the host is Autocad then they are the same.
Edited by: fantum on Mar 26, 2009 12:59 AM
Managed and native ObjectARX APIs are divided into two basic layers, one
that is not dependent on AutoCAD (as the 'host'), and can be used in RealDWG
applications (which for managed code, is acdbmdg.dll). and a second layer,
which is completely dependent on AutoCAD and cannot be used in RealDWG
applications (which for managed code, is acmdg.dll).
The HostApplicationServices object resides in the database layer, which
means that it is available to any application even when running in another
host (e.g., a RealDWG host application). The Document, DocumentCollection
and most other AutoCAD document/editor related APIs are in the application
layer (acmgd.dll), and are only available in AutoCAD.
So, if you are writing an application that you want to run in non-AutoCAD
RealDWG host applications, you cannot reference acmdg.dll or use anything
from it, and so the HostApplicationServices object is used to get the
In AutoCAD the two APIs always return the same database.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
wrote in message news:email@example.com...
Hi, Sorry about the newby question, but you try to search for the two
terms in the subject of this post: just about every thing ever written about
AutoCAD and .NET is returned. What is the difference between instantiating
my database with this: HostApplicationServices.WorkingDatabase and
with this : Application.DocumentManager.MdiActiveDocument.Database.
Is one better in certain circumstances? They seem to be used interchangeably
in the code I see. Thanks in advance for anyone with the time. Bernie