@@ -9,7 +9,12 @@ import {
99 AcDbFileType
1010} from './AcDbDatabaseConverterManager'
1111import { AcDbEntity } from '../entity'
12- import { AcDbAngleUnits , AcDbDataGenerator , AcDbUnitsValue } from '../misc'
12+ import {
13+ AcDbAngleUnits ,
14+ AcDbDataGenerator ,
15+ AcDbUnitsValue ,
16+ DEFAULT_TEXT_STYLE
17+ } from '../misc'
1318import {
1419 AcDbDictionary ,
1520 AcDbLayoutDictionary ,
@@ -276,6 +281,8 @@ export class AcDbDatabase extends AcDbObject {
276281 private _celweight : AcGiLineWeight
277282 /** Current layer for the database */
278283 private _clayer : string
284+ /** Current text style name for the database */
285+ private _textstyle : string
279286 /** The extents of current Model Space */
280287 private _extents : AcGeBox3d
281288 /** Insertion units for the database */
@@ -288,6 +295,8 @@ export class AcDbDatabase extends AcDbObject {
288295 private _pdmode : number
289296 /** Point display size */
290297 private _pdsize : number
298+ /** Running object snap mode bitmask */
299+ private _osmode : number
291300 /** Tables in the database */
292301 private _tables : AcDbTables
293302 /** Nongraphical objects in the database */
@@ -342,13 +351,15 @@ export class AcDbDatabase extends AcDbObject {
342351 this . _cecolor = new AcCmColor ( )
343352 this . _celweight = AcGiLineWeight . ByLayer
344353 this . _clayer = '0'
354+ this . _textstyle = DEFAULT_TEXT_STYLE
345355 this . _extents = new AcGeBox3d ( )
346356 // TODO: Default value is 1 (imperial) or 4 (metric)
347357 this . _insunits = AcDbUnitsValue . Millimeters
348358 this . _ltscale = 1
349359 this . _lwdisplay = true
350360 this . _pdmode = 0
351361 this . _pdsize = 0
362+ this . _osmode = 0
352363 this . _tables = {
353364 appIdTable : new AcDbRegAppTable ( this ) ,
354365 blockTable : new AcDbBlockTable ( this ) ,
@@ -642,7 +653,7 @@ export class AcDbDatabase extends AcDbObject {
642653 this . _cecolor ,
643654 value || 0 ,
644655 nextValue => {
645- this . _cecolor = nextValue
656+ this . _cecolor = nextValue . clone ( )
646657 }
647658 )
648659 }
@@ -700,6 +711,23 @@ export class AcDbDatabase extends AcDbObject {
700711 )
701712 }
702713
714+ /**
715+ * The text style name for new text objects.
716+ */
717+ get textstyle ( ) : string {
718+ return this . _textstyle
719+ }
720+ set textstyle ( value : string ) {
721+ this . updateSysVar (
722+ AcDbSystemVariables . TEXTSTYLE ,
723+ this . _textstyle ,
724+ value ?? DEFAULT_TEXT_STYLE ,
725+ nextValue => {
726+ this . _textstyle = nextValue
727+ }
728+ )
729+ }
730+
703731 /**
704732 * The zero (0) base angle with respect to the current UCS in radians.
705733 */
@@ -820,6 +848,23 @@ export class AcDbDatabase extends AcDbObject {
820848 )
821849 }
822850
851+ /**
852+ * Running Object Snap (OSNAP) mode bitmask.
853+ */
854+ get osmode ( ) : number {
855+ return this . _osmode
856+ }
857+ set osmode ( value : number ) {
858+ this . updateSysVar (
859+ AcDbSystemVariables . OSMODE ,
860+ this . _osmode ,
861+ value ?? 0 ,
862+ nextValue => {
863+ this . _osmode = nextValue
864+ }
865+ )
866+ }
867+
823868 /**
824869 * Reads drawing data from a string or ArrayBuffer.
825870 *
0 commit comments