Key-in: Working Units > Accuracy

Is there a key-in I can pair with the one below for setting the accuracy under the Working units? I was hoping to set up a batch to change this.

-SET UNITS [Master] [Sub]

Parents
  • Jan - glad to see I am in hte same hemisphere as someone else.

    this gave me the final peices I was looking for - Thnaks

    I did find an error in the documentation though.

    for Metric Accuracy it starts with 1 not zero

    1  =  1

    2  =  1.2

    3  =  1.23, etc

    Also = is required in the statements

    vba execute ActiveSettings.CoordinateAccuracy=Half   works

    vba execute ActiveSettings.CoordinateAccuracyHalf   does not work

    Then things don't work with the limited knowlege I have:

    vba execute ActiveSettings.CoordinateAccuracy=Half  This works fine

    vba execute ActiveSettings.CoordinateAccuracy=1       This Works Fine

    vba execute ActiveSettings.CoordinateAccuracy=8th   does not work

    vba execute ActiveSettings.CoordinateAccuracy8th     does not work

    vba execute ActiveSettings.CoordinateAccuracy 8th     does not work

    vba execute ActiveSettings.CoordinateAccuracy=eighth does not work

    vba execute ActiveSettings.CoordinateAccuracyeighth     does not work

    vba execute ActiveSettings.CoordinateAccuracy eighth     does not work

    The Same for 16th and so on

    Ustn since 1988
    SS4 - i7-3.45Ghz-16 Gb-250/1Tb/1Tb-Win8.1-64b

    Eric D. Milberger
    Architect + Master Planner + BIM

    Senior  Master Planner NASA - Marshall Space Flight Center

    The Milberger Architectural Group, llc

Reply
  • Jan - glad to see I am in hte same hemisphere as someone else.

    this gave me the final peices I was looking for - Thnaks

    I did find an error in the documentation though.

    for Metric Accuracy it starts with 1 not zero

    1  =  1

    2  =  1.2

    3  =  1.23, etc

    Also = is required in the statements

    vba execute ActiveSettings.CoordinateAccuracy=Half   works

    vba execute ActiveSettings.CoordinateAccuracyHalf   does not work

    Then things don't work with the limited knowlege I have:

    vba execute ActiveSettings.CoordinateAccuracy=Half  This works fine

    vba execute ActiveSettings.CoordinateAccuracy=1       This Works Fine

    vba execute ActiveSettings.CoordinateAccuracy=8th   does not work

    vba execute ActiveSettings.CoordinateAccuracy8th     does not work

    vba execute ActiveSettings.CoordinateAccuracy 8th     does not work

    vba execute ActiveSettings.CoordinateAccuracy=eighth does not work

    vba execute ActiveSettings.CoordinateAccuracyeighth     does not work

    vba execute ActiveSettings.CoordinateAccuracy eighth     does not work

    The Same for 16th and so on

    Ustn since 1988
    SS4 - i7-3.45Ghz-16 Gb-250/1Tb/1Tb-Win8.1-64b

    Eric D. Milberger
    Architect + Master Planner + BIM

    Senior  Master Planner NASA - Marshall Space Flight Center

    The Milberger Architectural Group, llc

Children
  • Hi Eric,

    Unknown said:

    I did find an error in the documentation though.

    for Metric Accuracy it starts with 1 not zero

    1  =  1

    2  =  1.2

    3  =  1.23, etc

    There is no error in the documentation, because the values are not important ... never. The only important are the names of constants (exactly they are members of MsdCoordinateAccuracy enumerator, which is a construction used in SW development) . It's not required the corresponding values are defined in any logic system:. Imagine a situation after few versions of ('any) software, you will realize you have to add a new option in your list. In the discussed case it can be e.g. accuracy of tens of units (so a readout of 8 will be 10). You will add a new constant name msdAccuracyTensOfUnits and will add a next free value (e. 1000). The result: Names are easy to understand, the code is easily readable, but the new value looks like accidental ;-)

    Unknown said:

    Also = is required in the statements

    Yes, because key-in vba execute means "Interpret the rest of the key-in as VBA code. And the code is ActiveSettings.CoordinateAccuracy = msdAccuracyHalf. The explanation is:

    • ActiveSetting is an object, as is deduced from its name,  which in MicroStation VBA API contains all MicroStation active settings.
    • .CoordinateAccuracy is setting of (suprise, isn't it? :-)) the coordinate accuracy settings.
    • The last part = msdAccuracyHalf is assignment, which set the new value of Coordinate Accuracy.

    Unknown said:

    Then things don't work with the limited knowlege I have:

    vba execute ActiveSettings.CoordinateAccuracy=Half  This works fine
    ...
    vba execute ActiveSettings.CoordinateAccuracy eighth     does not work

    You have to use names, exactly as defined in MicroStation VBA documentation:

    vba execute ActiveSettings.CoordinateAccuracy = msdAccuracyHalf
    vba execute ActiveSettings.CoordinateAccuracy = msdAccuracy0
    vba execute ActiveSettings.CoordinateAccuracy = msdAccuracy8th

    If you are familiar with VBA and VBA editor, you can try to type code there. It's easier, because the editor offers the possible values automatically.

    With regards,

      Jan

  • I am trying to play catch up on this question. I know you can manually change the Design file Accuracy. I recorded a macro for this, but I got nothing. As I step through it. It opens the Design file and the window for accuracy is open. The macrohandler has no values in it?

    I am going to paste the VBA routine and the Macro Handler.

    Sub MacroAccuracy()
        Dim startPoint As Point3d
        Dim point As Point3d, point2 As Point3d
        Dim lngTemp As Long

        Dim modalHandler As New Macro1ModalHandler6
        AddModalDialogEventsHandler modalHandler

    '   The following statement opens modal dialog "Design File Settings"

    '   Start a command
        CadInputQueue.SendCommand "MDL SILENTLOAD DGNSET"

        CadInputQueue.SendCommand "MDL SILENTUNLOAD DGNSET"

        RemoveModalDialogEventsHandler modalHandler
        CommandState.StartDefaultCommand
    End Sub

    Next the Macro1ModalHandler6

    Implements IModalDialogEvents
    Private Sub IModalDialogEvents_OnDialogClosed(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult)

    End Sub

    Private Sub IModalDialogEvents_OnDialogOpened(ByVal DialogBoxName As String, DialogResult As MsdDialogBoxResult)

        If DialogBoxName = "Design File Settings" Then

        '   Remove the following line to let the user close the dialog box.
            DialogResult = msdDialogBoxResultOK

        End If  ' Design File Settings

    End Sub

    Since I did a search for my question and this came up as an answer, I hope it is ok to continue the question???? Phil if this is wrong I am sorry.

     

    RJB Phillips III - Praise the Lord for His Mercy and Grace

  • There are a lot of modal dialogs that do not show anything if you try to record a macro. It can be frustrating - I know those settings exist in the program somewhere, but the most obvious way to figure them out gives me nothing...

    That said, this is easier than it sounds.

    vba execute ActiveSettings.CoordinateAccuracy = {number}

    is actually a key-in, that you can just enter in the keyin browser.
    {number} is the number of decimal places, plus 1 for your whole number, i.e. 5 gives you 0.1234 accuracy
    (I haven't played around with the fractions yet)

    If you want to put it into a macro, where you are setting up other settings as well, you would include a line that reads everything the follow the vba execute part.

    Does that help?

    MaryB

    Power GeoPak 08.11.09.918
    Power InRoads 08.11.09.918
    OpenRoads Designer 2021 R2

        

  • I am not able to put ActiveSettings.CoordinateAccuracy = {number}ie ActiveSettings.CoordinateAccuracy = 5 did nothing as a direct key-in I have vba that will change the accuracy examples:

    Sub Accuracy2()
    ' 122113 Drawing Accuracy setting, TEST
        ActiveSettings.CoordinateAccuracy = msdAccuracy2
        CadInputQueue.SendKeyin "m,ms        Set Accuracy 0.01"
    End Sub
    Sub Accuracy3()
    ' 122113 Drawing Accuracy setting, TEST
        ActiveSettings.CoordinateAccuracy = msdAccuracy3
        CadInputQueue.SendKeyin "m,ms        Set Accuracy 0.001"
    End Sub
    Sub Accuracy4()
    ' 122113 Drawing Accuracy setting, TEST
        ActiveSettings.CoordinateAccuracy = msdAccuracy4
        CadInputQueue.SendKeyin "m,ms        Set Accuracy 0.0001"
    End Sub
    Sub Accuracy5()
    ' 122113 Drawing Accuracy setting, TEST
        ActiveSettings.CoordinateAccuracy = msdAccuracy5
        CadInputQueue.SendKeyin "m,ms        Set Accuracy 0.00001"
    End Sub

    These all work but I still would like to know how to just do it via Key-in

    point me to the answer if anyone knows Lorys mentioned basic but do not know really how to use the older basic anymore.

    Version: MicroStation V8i SS 10

    RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus

  • Unknown said:
    Lorys mentioned basic but do not know really how to use the older basic anymore

    Keep it that way!  Anything that BASIC could do, VBA does better.  Don't let Lorys drag you into the quicksands of  20th century technology in 2018!

     
    Regards, Jon Summers
    LA Solutions