Creates a new AcDbDatabase instance.
Readonly
eventsEvents that can be triggered by the database.
These events allow applications to respond to various database operations such as entity modifications, layer changes, and progress updates.
Fired when an entity is appended to the database
Fired when an entity is modified in the database
Fired when a header system variable is changed
Fired when a layer is appended to the database
Fired when a layer is erased from the database
Fired when a layer is modified in the database
Fired during database opening operations to report progress
The zero (0) base angle with respect to the current UCS in radians.
The direction of positive angles.
Gets the attributes object for this AcDbObject.
The AcCmObject instance containing all attributes
Gets the angle units for the database.
This is the current AUNITS value for the database.
The angle units value
Sets the angle units for the database.
The new angle units value
The line type scaling for new objects relative to the ltscale setting. A line created with celtscale = 2 in a drawing with ltscale set to 0.5 would appear the same as a line created with celtscale = 1 in a drawing with ltscale = 1.
Gets the object ID of the AcDbBlockTableRecord of the current space.
The current space can be either model space or paper space.
The object ID of the current space
Sets the current space by object ID.
The object ID of the block table record to set as current space
Gets the database in which this object is resident.
When an object isn't added to a database, this property returns the current working database. After it is added to a database, it will be set automatically. You should never set this value manually.
The database this object belongs to
Sets the database for this object.
This is typically set automatically when the object is added to a database. Manual setting should be avoided unless you know what you're doing.
The database to associate with this object
Gets all named object dictionaries in this drawing database.
Object containing all the dictionaries in the database
Gets the drawing-units value for automatic scaling of blocks, images, or xrefs.
This is the current INSUNITS value for the database.
The insertion units value
Sets the drawing-units value for automatic scaling.
The new insertion units value
Gets the line type scale factor.
The line type scale factor
Sets the line type scale factor.
The new line type scale factor
Gets the object ID.
AutoCAD uses 64-bit integers to represent handles, which exceed the maximum integer value of JavaScript. Therefore, strings are used to represent object handles.
The object ID as a string
Sets the object ID.
The new object ID
Gets the object ID of the owner of this object.
The owner object ID
Sets the object ID of the owner of this object.
The new owner object ID
Point display mode. Please get more details on value of this property from this page.
Point display size.
0: Specifie an absolute size
Gets all tables in this drawing database.
Object containing all the symbol tables in the database
Gets the value of the specified attribute.
This method will throw an exception if the specified attribute doesn't exist. Use getAttrWithoutException() if you want to handle missing attributes gracefully.
The name of the attribute to retrieve
The value of the specified attribute
Gets the value of the specified attribute without throwing an exception.
This method returns undefined if the specified attribute doesn't exist, making it safer for optional attributes.
The name of the attribute to retrieve
The value of the specified attribute, or undefined if it doesn't exist
Read AutoCAD DXF or DWG drawing specified by the URL into the database object. The method automatically detects the file type based on the URL extension:
Input the URL linked to one AutoCAD DXF or DWG file
Input options to read drawing data
Reads drawing data from a string or ArrayBuffer.
This method parses the provided data and populates the database with the resulting entities, tables, and objects. The method supports both DXF and DWG file formats.
The drawing data as a string or ArrayBuffer
Options for reading the database
The type of file being read (defaults to DXF)
Sets the value of an attribute.
The name of the attribute to set
Optional
val: AcDbObjectAttrs[A]The value to assign to the attribute
The AcDbDatabase class represents an AutoCAD drawing file.
Each AcDbDatabase object contains the various header variables, symbol tables, table records, entities, and objects that make up the drawing. The AcDbDatabase class has member functions to allow access to all the symbol tables, to read and write to DWG files, to get or set database defaults, to execute various database-level operations, and to get or set all header variables.
Example