Drawing Objects

AutoCAD Map 3D .NET API

 
Drawing Objects
 
 
 

Drawing objects are the visible items in an AutoCAD drawing.

NoteThe AutoCAD developer documentation generally uses the term entity or AcDb entity when discussing drawing objects.

In the AutoCAD API, an Autodesk.AutoCAD.DatabaseServices.DBObject object represents any object in the drawing database, including drawing objects. A DBObject can be referred to by either:

  • Autodesk.AutoCAD.DatabaseServices.Handle
  • Autodesk.AutoCAD.DatabaseServices.ObjectID

A Handle is a persistent identifier that is stored with the AutoCAD database when it is saved. Each handle is unique within a single drawing, but different drawings are likely to have duplicate handles referring to separate objects.

An ObjectID is used for quick access to drawing objects within an AutoCAD session. They are not persistent, though. They expire when the drawing is closed.

Map Objects

Because a single AutoCAD Map 3D project can include more than one AutoCAD drawing, an AutoCAD handle is not sufficient to uniquely identify an object.

A MapObjectId, defined in the namespace Autodesk.Gis.Map.Utilities, identifies an object by its AutoCAD handle and by its drawing identifier. The MapObjectId.ObjectHandle property is the AutoCAD handle, and MapObjectId.DrawingId is the drawing identifier, an object of type Utilities.MapId.