Posts: 15
Registered: ‎05-31-2012
Message 1 of 4 (328 Views)

DBObject vs. Entity

328 Views, 3 Replies
05-31-2012 01:10 AM

I'm really newb in autocad.net. I didn't understand clearly about these type.

in code from Mr. Kean Walmsley:

Transactiontr =  doc.TransactionManager.StartTransaction();

using (tr)


            DBObject obj =  tr.GetObject(id, OpenMode.ForWrite);




But I use type Entity also can get the same result. So what is different between them. And how to use them in a good way.

*Expert Elite*
Posts: 1,565
Registered: ‎10-08-2008
Message 2 of 4 (327 Views)

Re: DBObject vs. Entity

05-31-2012 01:21 AM in reply to: Nk_long

If these both are graphical objects

 so there is no difference between them,



Distinguished Contributor
Posts: 104
Registered: ‎04-21-2011
Message 3 of 4 (321 Views)

Re: DBObject vs. Entity

05-31-2012 01:37 AM in reply to: Hallex
To quote the ObjectARX docs: "The DBObject class is the base class for all objects that reside in an Database object." The Entity class directly inherits from DBObject. The Transaction.GetObject() method returns a DBObject type and you then cast it to other types. So if your ObjectId references an Entity, you can cast the DBObject to type Entity and then access the Entity members. I recommend you check out the ObjectARX arxmgd.chm file or use Reflector to get a better feel for the AutoCAD .NET inheritance chains.
*Expert Elite*
Posts: 1,565
Registered: ‎10-08-2008
Message 4 of 4 (313 Views)

Re: DBObject vs. Entity

05-31-2012 02:23 AM in reply to: Artvegas

Thanks, I forgot about ObjectARX docs




You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community