Objects of this class represent the records found in the dimension style table. Each of these records contains the information necessary to generate a specific appearance (that is, text above, in, or below the line; arrows, slashes, or dots at the end of the dimension line, and so on) for dimensions that reference it.

Hierarchy (View Summary)

Constructors

Properties

DEFAULT_DIM_VALUES: AcDbDimStyleTableRecordAttrs = ...

Accessors

  • get database(): AcDbDatabase
  • 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.

    Returns AcDbDatabase

    The database this object belongs to

    const db = obj.database;
    
  • set database(db: AcDbDatabase): void
  • 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.

    Parameters

    Returns void

    obj.database = myDatabase;
    
  • get dimaltf(): number
  • Alternate dimensioning. The default value of DIMALT is set to 0 for DIMALTF (Dimension Alternate Text Format), which means that alternate dimensions are not displayed by default. When DIMALT is set to 1, it indicates that alternate dimensioning is enabled, and you can use DIMALTF to specify the format of the alternate dimension text. You can set it to various values depending on how you want the alternate dimensions to be displayed.

    Returns number

  • set dimaltf(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimaltu(): number
  • Dimension alternate unit format. This property controls the units format for alternate units of all dimension substyles except Angular. The value of this property include:

    • 1: Scientific
    • 2: Decimal
    • 3: Engineering
    • 4: Architectural (stacked)
    • 5: Fractional (stacked)
    • 6: Architectural
    • 7: Fractional
    • 8: Microsoft Windows Desktop (decimal format using Control Panel settings for decimal separator and number grouping symbols)

    Returns number

  • set dimaltu(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimapost(): string
  • Dimension append postfix. This property specifies a text prefix or suffix (or both) to the alternate dimension measurement for all types of dimensions except angular. For instance, if the current units are Architectural, DIMALT is on, DIMALTF is 25.4 (the number of millimeters per inch), DIMALTD is 2, and DIMAPOST is set to "mm", a distance of 10 units would be displayed as 10"[254.00mm]. To turn off an established prefix or suffix (or both), set it to a single period (.).

    Returns string

  • set dimapost(value: string): void
  • Parameters

    • value: string

    Returns void

  • get dimatfit(): number
  • Dimension angular tolerance fit. This property determines how dimension text and arrows are arranged when space is not sufficient to place both within the extension lines.

    • 0: Places both text and arrows outside extension lines
    • 1: Moves arrows first, then text
    • 2: Moves text first, then arrows
    • 3: Moves either text or arrows, whichever fits best A leader is added to moved dimension text when DIMTMOVE is set to 1.

    Returns number

  • set dimatfit(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimdec(): number
  • Dimension decimal places. This property controls the number of decimal places displayed for the primary units of a dimension. Its initial value is 4 for imperial unit or 2 for metric unit. The precision is based on the units or angle format you have selected. Specified value is applied to angular dimensions when DIMADEC is set to -1.

    Returns number

  • set dimdec(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimfit(): number
  • Dimension fit. This property controls how dimension text fits within the dimension line. The value of this property include:

    • 0: Fit (default) – The dimension text is placed outside the dimension lines if it does not fit inside.
    • 1: Above – The dimension text is placed above the dimension line.
    • 2: Center – The dimension text is centered between the extension lines. With the default setting of 0, the software automatically positions the dimension text based on available space.

    Returns number

  • set dimfit(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimjust(): number
  • Dimension text justification. This property controls the horizontal positioning of dimension text.

    • 0: Positions the text above the dimension line and center-justifies it between the extension lines
    • 1: Positions the text next to the first extension line
    • 2: Positions the text next to the second extension line
    • 3: Positions the text above and aligned with the first extension line
    • 4: Positions the text above and aligned with the second extension line

    Returns number

  • set dimjust(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimlfac(): number
  • Dimension linear factor. This property controls the scaling factor for linear dimensions. If you want to adjust the size of linear dimensions without changing the actual dimension text height or other dimension settings, you can modify this value. A setting of 1.0 means that dimensions are displayed at their actual size.

    Returns number

  • set dimlfac(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimlunit(): number
  • Dimension linear units. This property controls units for all dimension types except angular. The value of this property include:

    • 1: Scientific
    • 2: Decimal
    • 3: Engineering
    • 4: Architectural (always displayed stacked)
    • 5: Fractional (always displayed stacked)
    • 6: Microsoft Windows Desktop (decimal format using Control Panel settings for decimal separator and number grouping symbols)

    Returns number

  • set dimlunit(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimlwd(): number
  • Dimension line weight. This property controls lineweight to dimension lines.

    • -1: Sets the lineweight to "BYLAYER."
    • -2: Sets the lineweight to "BYBLOCK."
    • -3: Sets the lineweight to "DEFAULT." "DEFAULT" is controlled by the LWDEFAULT system variable. Other valid values entered in hundredths of millimeters include 0, 5, 9, 13, 15, 18, 20, 25, 30, 35, 40, 50, 53, 60, 70, 80, 90, 100, 106, 120, 140, 158, 200, and 211. All values must be entered in hundredths of millimeters. (Multiply a value by 2540 to convert values from inches to hundredths of millimeters.)

    Returns number

  • set dimlwd(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimlwe(): number
  • Dimension line weight for extension lines. This property controls lineweight to extension lines.

    • -1: Sets the lineweight to "BYLAYER."
    • -2: Sets the lineweight to "BYBLOCK."
    • -3: Sets the lineweight to "DEFAULT." "DEFAULT" is controlled by the LWDEFAULT system variable. Other valid values entered in hundredths of millimeters include 0, 5, 9, 13, 15, 18, 20, 25, 30, 35, 40, 50, 53, 60, 70, 80, 90, 100, 106, 120, 140, 158, 200, and 211. All values must be entered in hundredths of millimeters. (Multiply a value by 2540 to convert values from inches to hundredths of millimeters.)

    Returns number

  • set dimlwe(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimpost(): string
  • Dimension postfix. This property specifies a text prefix or suffix (or both) to the dimension measurement. For example, to establish a suffix for millimeters, set DIMPOST to mm; a distance of 19.2 units would be displayed as 19.2 mm. If tolerances are turned on, the suffix is applied to the tolerances as well as to the main dimension. Use <> to indicate placement of the text in relation to the dimension value. For example, enter <>mm to display a 5.0 millimeter radial dimension as "5.0mm". If you entered mm <>, the dimension would be displayed as "mm 5.0". Use the <> mechanism for angular dimensions.

    Returns string

  • set dimpost(value: string): void
  • Parameters

    • value: string

    Returns void

  • get dimsoxd(): 0 | 1
  • Dimension suppress offset x-direction. This property controls whether to suppresses arrowheads if not enough space is available inside the extension lines. If not enough space is available inside the extension lines and DIMTIX is on, setting DIMSOXD to On suppresses the arrowheads. If DIMTIX is off, DIMSOXD has no effect.

    • 0: Arrowheads are not suppressed
    • 1: Arrowheads are suppressed

    Returns 0 | 1

  • set dimsoxd(value: 0 | 1): void
  • Parameters

    • value: 0 | 1

    Returns void

  • get dimtad(): AcDbDimTextVertical
  • Dimension text above dimension line. This property the vertical position of text in relation to the dimension line.

    • 0: Centers the dimension text between the extension lines.
    • 1: Places the dimension text above the dimension line except when the dimension line is not horizontal and text inside the extension lines is forced horizontal ( DIMTIH = 1). The distance from the dimension line to the baseline of the lowest line of text is the current DIMGAP value.
    • 2: Places the dimension text on the side of the dimension line farthest away from the defining points.
    • 3: Places the dimension text to conform to Japanese Industrial Standards (JIS).
    • 4: Places the dimension text below the dimension line.

    Returns AcDbDimTextVertical

  • set dimtad(value: AcDbDimTextVertical): void
  • Parameters

    Returns void

  • get dimtfac(): number
  • Dimension text factor. This property is used to scale the height of dimension text based on the current DIMTXT value. If you set DIMTFAC to a value greater than 1.0, the dimension text will be larger than the default height specified by DIMTXT. Conversely, setting it to a value less than 1.0 will make the text smaller.

    Returns number

  • set dimtfac(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimtix(): 0 | 1
  • Dimension text inside extension lines. This property controls the position of dimension text relative to the extension lines.

    • 0: For linear and angular dimensions, dimension text is placed inside the extension lines if there is sufficient room.
    • 1: Draws dimension text between the extension lines even if it would ordinarily be placed outside those lines. For radius and diameter dimensions, DIMTIX on always forces the dimension text outside the circle or arc.

    Returns 0 | 1

  • set dimtix(value: 0 | 1): void
  • Parameters

    • value: 0 | 1

    Returns void

  • get dimtofl(): 0 | 1
  • Dimension to first extension line. This property controls whether a dimension line is drawn between the extension lines even when the text is placed outside. For radius and diameter dimensions, a dimension line is drawn inside the circle or arc when the text, arrowheads, and leader are placed outside.

    • 0: Does not draw dimension lines between the measured points when arrowheads are placed outside the measured points
    • 1: Draws dimension lines between the measured points even when arrowheads are placed outside the measured points

    Returns 0 | 1

  • set dimtofl(value: 0 | 1): void
  • Parameters

    • value: 0 | 1

    Returns void

  • get dimtvp(): number
  • Dimension text vertical position. This property controls the vertical position of dimension text relative to the dimension line. A value of 0.0 means that the dimension text is placed directly on the dimension line. You can adjust this value to change the vertical offset of the dimension text above or below the dimension line.

    Returns number

  • set dimtvp(value: number): void
  • Parameters

    • value: number

    Returns void

  • get dimunit(): number
  • Dimension linear units. This property controls the format in which linear dimensions are displayed. The value of this property include:

    • 1: Scientific
    • 2: Decimal
    • 3: Engineering
    • 4: Architectural (always displayed stacked)
    • 5: Fractional (always displayed stacked)
    • 6: Microsoft Windows Desktop (decimal format using Control Panel settings for decimal separator and number grouping symbols)

    Returns number

  • set dimunit(value: number): void
  • Parameters

    • value: number

    Returns void

  • get name(): string
  • Gets or sets the name of the symbol table record.

    This property corresponds to DXF group code 2 and is used for identifying and referencing the symbol table record.

    Returns string

    The name of the symbol table record

    const recordName = record.name;
    record.name = 'NewRecordName';
  • set name(value: string): void
  • Parameters

    • value: string

    Returns void

  • get objectId(): string
  • 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.

    Returns string

    The object ID as a string

    const id = obj.objectId;
    console.log(`Object ID: ${id}`);
  • set objectId(value: string): void
  • Sets the object ID.

    Parameters

    • value: string

      The new object ID

    Returns void

    obj.objectId = 'new-object-id';
    
  • get ownerId(): string
  • Gets the object ID of the owner of this object.

    Returns string

    The owner object ID

    const ownerId = obj.ownerId;
    
  • set ownerId(value: string): void
  • Sets the object ID of the owner of this object.

    Parameters

    • value: string

      The new owner object ID

    Returns void

    obj.ownerId = 'parent-object-id';
    

Methods

  • Closes the object.

    All changes made to the object since it was opened are committed to the database, and a "closed" notification is sent. This method can be overridden by subclasses to provide specific cleanup behavior.

    Returns void

    obj.close();
    
  • 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.

    Parameters

    • attrName: string

      The name of the attribute to retrieve

    Returns any

    The value of the specified attribute

    When the specified attribute doesn't exist

    try {
    const value = obj.getAttr('objectId');
    } catch (error) {
    console.error('Attribute not found');
    }
  • 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.

    Parameters

    • attrName: string

      The name of the attribute to retrieve

    Returns any

    The value of the specified attribute, or undefined if it doesn't exist

    const value = obj.getAttrWithoutException('optionalAttribute');
    if (value !== undefined) {
    // Use the value
    }