Using It! - Rounding Dimensions

Originally published 4 Feb 2015

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 are now methods available for both CONNECT Edition and V8i.

CONNECT Edition:

The calculate functionality has changed in CONNECT Edition so the V8i workaround is not available (as discussed in the comments below), but my colleague Yong An Fu has written an MDL application that provides a much simpler solution.

Warning! Before using this be aware that the existence of rounding is not explicitly evident in either element properties or the Dimension Styles dialog. Also be aware that the rounding is applied to each individual dimension so an overall dimension may not round to the sum of the sub-dimensions as seen here:

The best approach to using this MDL is to use it only for creating dimension styles named to clearly identify that they are rounded. I would not make this available to all users as applying rounding to individual dimensions is unmanageable and likely to cause confusion downstream.

To use:

Extract the contents of this file to C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\Mdlapps or to a Mdlapps folder in your Custom Configuration that is only accessible to CAD administrators.

6507.SetDimRound.zip

Keyin MDL LOAD SetDimRound n to apply the rounding value to the active current dimension style. The value applies to the active working units. For example:

to apply a 5mm rounding with active working units set to mm

MDL LOAD SetDimRound 5.0

to apply a 10mm rounding

MDL LOAD SetDimRound 10.0

To reset to no rounding key-in:

MDL LOAD SetDimRound (without any argument)

This MDL application will execute then unload itself, it does not need to run in the background, it just does the job and leaves recording two lines in the message center:

Create appropriately named Dimension styles and save then to a dimension styles DGNLIB (preferably specified by MS_DGNLIBLIST_DIMENSIONSTYLES, it is generally helpful to keep organize DGNLIB resources using the specific variable where available).

Advise users to only use rounding via dimension styles as the style name will make the rounding evident to subsequent editors.

Rounding can be removed form existing dimensions using the Change Dimension tool to apply an un-rounded style.

Examples:

An example with working units set to mm (rounded dimensions in red):

and set to m:

Further Development:

Defect 1073871 "Dimensions cannot be rounded off to the nearest 5mm" has been filed to track the requirement for this functionality. Please file a Service Request mentioning this defect number if you are keen to have this capability added to CONNECT Edition core functionality .

V8i Only:

Use the key-in describe below to 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.

Parents
  • Jon is right. mdlDimStyle_xxx C functions are replaced by a C++ class DimensionStyle which can't be called directly by using calcuator.

    So I wrote an MDL application SetDimRound to resolve this issue.

    SetDimRound.zip

    [Usage]:

    1. Unzip this zip file to folder C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\Mdlapps

    2. Keyin MDL LOAD SetDimRound n to set current dimension style's round off value. For example,

    MDL LOAD SetDimRound 5.0 is equivalent to mdl load calculat; calculator mdlDimStyle_setDoubleProp(mdlDimStyle_getActive(), 5.0, 1083)

    MDL LOAD SetDimRound (without any argument) can set round off to default. It is equivalent to mdl load calculat; calculator mdlDimStyle_setDoubleProp(mdlDimStyle_getActive(), 0.0, 1083)

    This MDL application will unload itself, so you can load it multiple times without need to first unload it. It is simpler than MSV8i.

    HTH,   YongAn

Comment
  • Jon is right. mdlDimStyle_xxx C functions are replaced by a C++ class DimensionStyle which can't be called directly by using calcuator.

    So I wrote an MDL application SetDimRound to resolve this issue.

    SetDimRound.zip

    [Usage]:

    1. Unzip this zip file to folder C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\Mdlapps

    2. Keyin MDL LOAD SetDimRound n to set current dimension style's round off value. For example,

    MDL LOAD SetDimRound 5.0 is equivalent to mdl load calculat; calculator mdlDimStyle_setDoubleProp(mdlDimStyle_getActive(), 5.0, 1083)

    MDL LOAD SetDimRound (without any argument) can set round off to default. It is equivalent to mdl load calculat; calculator mdlDimStyle_setDoubleProp(mdlDimStyle_getActive(), 0.0, 1083)

    This MDL application will unload itself, so you can load it multiple times without need to first unload it. It is simpler than MSV8i.

    HTH,   YongAn

Children