Coordiantes Readout Accuracy Settings.....
Hi,
I want to set Coordinates ReadOut Accuracy settings by using Command (Keyin) . It there any command (keyin) to set coordinates accuracy ?
Coordinate readout is documented in MicroStation under the heading Preparing to Draw Content. It doesn't mention a keyin.
Here's how to obtain the coordinate readout precision with MDL …
//////////////////////////////////////////////////////////////////////////////////////////////////// /// Converts MDL global variable tcb->ad1.format.adres2 to number /// of decimal digits. /// int precision. //////////////////////////////////////////////////////////////////////////////////////////////////// int MicroStation::DecimalPrecision ( void ) { int precision = DEFAULT_PRECISION; // Decimal Precision controls the number of // digits after the decimal point (value of // Settings->Co-ordinate Readout precision) // // Acc. tcb->ad1.format.adres2 tcb->ad1.format.ref_decfract // 0 1 0 // 0.1 2 0 // 0.12 3 0 // 0.123 4 0 // 0.1234 0 0 // 0.12345 6 // 0.123456 7 switch (tcb->ad1.format.adres2) { case 5: case 0: precision = DEFAULT_PRECISION; break; default: // Ensure we're in valid range if (0 > tcb->ad1.format.adres2 || 7 < tcb->ad1.format.adres2) precision = DEFAULT_PRECISION; else precision = tcb->ad1.format.adres2 - 1; break; } return precision; }
Use MicroStation VBA's GetCExpression function to work with TCB variables. See our article about navigating the TCB for more information. Here's some sample VBA code …
' -----------------------------------------------------------------' DisplayCoordinateAccuracy' Get the current coordinate accuracy setting' ----------------------------------------------------------------- Public Function DisplayCoordinateAccuracy() As Integer Const DEFAULT_PRECISION As Integer = 4 DisplayCoordinateAccuracy = DEFAULT_PRECISION Dim precision As Integer Dim tcb_setting As Integer tcb_setting = Application.GetCExpressionValue("tcb->ad1.format.adres2") Select Case tcb_setting Case 5, 0 precision = DEFAULT_PRECISION Case Else precision = tcb_setting - 1 End Select DisplayCoordinateAccuracy = precision End Function
Regards, Jon Summers LA Solutions
thanks a lot.