Rounding Dimensions

We have had a few questions about rounding dimensions to the nearest 5mm. This is not currently available via the Dimension Styles dialog but there is a method using a key-in that can modify an existing dimension style. You can test this in any design file without affecting standards then copy the modified dimension style to your standards dgnlib.

  • Open the Dimension Styles Dialog
  • Copy an existing style and rename with the suffix rounded (or whatever name convention your prefer/require).
  • Set the copied style active
  • On the Units tab > Primary Units set
    • Accuracy 0.1
    • Untick Trailing Zeros
  • in the key-in dialog enter:
  • mdl load calculat; calculator mdlDimStyle_setDoubleProp(mdlDimStyle_getActive(), 5.0, 1083)
  • Save the modified dimension style.

[please note the initial part of the command line is calculat, no 'e' at the end! DOS 8 character file naming lives on.]

In this illustration the lower dimension string has the rounding applied.

You can also use the command string as a temporary override without changing or creating any library styles, in which case updating the style from the library would reset it to the company standard, removing the rounding setting.

Also note that if a dimension with rounding exists you could also use the match text attributes tool to pick up the rounding setting.

Background

'mdl load calculat' starts C:\Program Files (x86)\Bentley\AECOsimBuildingDesigner V8i Ss5\AECOsimBuildingDesigner\mdlsys\asneeded\calculat.ma

In this instance it is used to access an mdl command via the mdlDimStyle api. If you want to find out more about that topic area you can:

  • download the MicroStation V8i SDK and it's documentation
  • join discussions in the MicroStation Programming forum

Search MicroStation help for the string "Calculator/Preprocessor" for guidance on the more general functions available from calculate.ma.