Drawings SDK Developer Guide > Working with .dwg Files > Working with Entities > Working with Specific Entitites > Working with Dimensions > Working with Common Dimension Entities > Working with Dimension Values
Working with Dimension Values

Primary, angular, alternate, and tolerance values can be rounded to the specified real number, limited to the specified number of decimal places, purged from leading and trailing zeros, suppressed from zero inch or zero feet, and represented in a specified format. You can independently specify the processing of the primary measured value, alternate measured value, primary tolerance value, alternate tolerance value, angular measured value, and angular tolerance value for dimension entities.

Dimrnd, Dimaltrnd

The Dimrnd and Dimaltrnd values are the non-negative double values that store the real number to round the primary and alternate measured values respectively (not tolerance values). For example, if the rounding is set to 0.04, the value will be rounded to the nearest 0.04 unit. Thus, 1.912 becomes 1.92, 1.935 becomes 1.92, 1.945 becomes 1.96, and 1.972 becomes 1.96. If the rounding is set to 1.0, the value will be rounded to the nearest integer value.

The initial value is 0.0 for each of them.

Note: The Dimrnd and Dimaltrnd values are not available for angular dimension entities.

To get the Dimrnd and Dimaltrnd values, use the dimrnd() and dimaltrnd() methods, which return Dimrnd and Dimaltrnd as double values.

For example:


odPrintConsoleString(L"\nDimrnd value is %f", pDimension->dimrnd());
odPrintConsoleString(L"\nDimaltrnd value is %f", pDimension->dimaltrnd());

To set the new Dimrnd and Dimaltrnd values, use the setDimrnd() and setDimaltrnd() methods, which require one double parameter to specify the new Dimrnd or Dimaltrnd value.

For example:


pDimension->setDimrnd(0.03);
pDimension->setDimaltrnd(0.1);

Dimadec, Dimdec, Dimaltd, Dimtdec, Dimalttd

These values control the number of decimal places in values.

The Dimadec value is an OdInt16 value that stores the number of decimal places to display in an angular measured value and angular tolerance. The value can be one of the following:

  • -1 — The number of decimal places defined by the Dimdec value.
  • 0 to 8 — Specifies the number of decimal places.

The initial value of Dimadec is 0.

The Dimdec value is an OdInt16 value that stores the number of decimal places for the primary measured value. The number set by Dimdec can be applied to an angular dimension if the Dimadec value is set to -1. The initial value of Dimdec is 4, which isn't applicable to angular dimensions.

The Dimaltd value is an OdUInt16 value that stores the number of decimal places for the alternate measured value. The initial value of Dimaltd is 2, which isn't applicable to angular dimensions.

The Dimtdec value is an OdInt16 value that stores the number of decimal places for the primary tolerance value. The initial value of Dimtdec is 4, which has effect only if the tolerance display is on (Dimtol is true). This value isn't applicable to angular dimensions.

The Dimalttd value is an OdInt16 value that stores the number of decimal places for the alternate tolerance value. The initial value of Dimalttd is 2, which has effect only if the tolerance display is on (Dimtol is true). This value isn't applicable to angular dimensions.

To get these values, use the dimadec(), dimdec(), dimaltd(), dimtdec() and dimalttd() methods, which return the values as integer values.

For example:


odPrintConsoleString(L"\nDimadec value is %d", pDimension->dimadec());
odPrintConsoleString(L"\nDimdec value is %d", pDimension->dimdec());
odPrintConsoleString(L"\nDimaltd value is %d", pDimension->dimaltd());
odPrintConsoleString(L"\nDimtdec value is %d", pDimension->dimtdec());
odPrintConsoleString(L"\nDimalttd value is %d", pDimension->dimalttd());

To set new Dimadec, Dimdec, Dimaltd, Dimtdec and Dimalttd values, use the setDimadec(), setDimdec(), setDimaltd(), setDimtdec() and setDimalttd() methods, which require one integer parameter as a new value.

For example:


pDimension->setDimadec(-1);
pDimension->setDimdec(1);
pDimension->setDimaltd(2);
pDimension->setDimtdec(3);
pDimension->setDimalttd(4);

DIMZIN, DIMAZIN, DIMALTZ, DIMTZIN, DIMALTTZ

The Dimzin and Dimaltz values are used for the suppression of zeros in primary and alternate measured values, respectively. They are non-negative integer values and can have the following values (values 0-3 affect feet-and-inch dimensions only):

  • 0 — Suppresses zero feet and zero inches.
  • 1 — Includes zero feet and zero inches.
  • 2 — Suppresses zero inches and includes zero feet.
  • 3 — Suppresses zero feet and includes zero inches.
  • 4 — Suppresses leading zeros. For example, 0.1234 will be displayed as .1234.
  • 8 — Suppresses trailing zeros. For example, 0.1234000 will be displayed as 0.1234.
  • 12 — Suppresses both leading and trailing zeros. For example, 0.1234000 will be displayed as .1234.

The initial value for both of them is 0.

Note: The Dimaltz value isn't available for angular dimension entities.

Note: The suppression of zeros in feet-and-inch measurements is actual when the units format is architectural or engineering (Dimlunit and Dimaltu have values 3 or 4).

To get the Dimzin and Dimaltz values, use the dimzin() and dimaltz() methods, which return the Dimzin and Dimaltz values as OdUInt8 values.

For example:


odPrintConsoleString(L"\nDimzin value is %d", pDimension->dimzin());
odPrintConsoleString(L"\nDimaltz value is %d", pDimension->dimaltz());

To set new Dimzin and Dimaltz values, use the setDimzin() and setDimaltz() methods, which require one OdUInt8 parameter as a new Dimzin or Dimaltz value.

For example:


pDimension->setDimzin(1);
pDimension->setDimaltz(8);

The Dimazin value is used for controlling the suppression of zeros in an angular measured value and tolerance. It is a non-negative integer value and it can be one of the following:

  • 0 — Includes all leading and trailing zeros.
  • 1 — Suppresses leading zeros.
  • 2 — Suppresses trailing zeros.
  • 3 — Suppresses leading and trailing zeros.

The initial value is 0.

Note: The Dimazin value is applicable only for angular dimension entities.

To get the Dimazin value, use the dimazin() method, which returns the Dimazin value as an OdInt16 value.

For example:


odPrintConsoleString(L"\nDimazin value is %d", pDimension->dimazin());

To set a new Dimazin value, use the setDimazin() method, which requires one OdInt16 parameter as a new Dimazin value.

For example:


pDimension->setDimazin(2);

The Dimtzin and Dimalttz values are used for controlling the suppression of zeros in primary and alternate tolerance values, respectively. They are non-negative integer values that can have the following values (values 0-3 affect feet-and-inch dimensions only):

  • 0 — Suppresses zero feet and zero inches.
  • 1 — Includes zero feet and zero inches.
  • 2 — Suppresses zero inches and includes zero feet.
  • 3 — Suppresses zero feet and includes zero inches.
  • 4 — Suppresses leading zeros. For example, 0.1234 will be displayed as .1234.
  • 8 — Suppresses trailing zeros. For example, 0.1234000 will be displayed as 0.1234.
  • 12 — Suppresses both leading and trailing zeros. For example, 0.1234000 will be displayed as .1234.

The initial value for both of them is 0.

Note: The Dimalttz value isn't available for angular dimension entities.

Note: The suppression of zeros in feet-and-inch measurements is actual when the units format is architectural or engineering (Dimlunit and Dimaltu have values 3 or 4).

To get the Dimtzin and Dimalttz values, use the dimtzin() and dimalttz() methods, which return the Dimtzin and Dimalttz values as OdUInt8 values.

For example:


odPrintConsoleString(L"\nDimtzin value is %d", pDimension->dimtzin());
odPrintConsoleString(L"\nDimalttz value is %d", pDimension->dimalttz());

To set the new Dimtzin and Dimalttz values, use the setDimtzin() and setDimalttz() methods, which require one OdUInt8 parameter as a new Dimtzin or Dimalttz value.

For example:


pDimension->setDimtzin(2);
pDimension->setDimalttz(4);

See Also

Working with Dimensions

Working with Common Dimension Entity

Working with General Dimension Methods

Positioning Dimension Text

Formatting Dimension Text

Working with Dimension Lines

Working with Extension Lines

Working with Dimension Fit and Movement

Working with Dimension Tolerances

Working with Primary Unit Measurements

Working with Alternate Unit Measurements

Marking the Center of Dimensions

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.