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

  • 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

Reply Children
  • Excuse me  "dont  let let Lorys Drag you?"  that is a bit harsh... I believe in we should use ALL the tools available to you even basic!and  if it gives you the  key in your searching  for well and  good if not then try  something else  like vba recorder...I'll admit I have a personal preference for basic  and may even be the wrong  direction, because  its what I know better as I'm a drafter and  NOT a coder, but I'll let the personal slur go, this time,  but lets not get  personal even if we are passionate about what  we do and say  after all were all "brothers"in the mstn fraternity and are only here to help one another right?

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

  • Excuse me  "dont  let let Lorys Drag you?"  that is a bit harsh...

    Well, it probably is ... not sure as I am not a native speaker, so I am lost in tiny language details ... but in my opinion Jon is right in fact.

    I believe in we should use ALL the tools available to you even basic!

    No. Especially in the situation when the tool is released as obsolete (and as such not developed anymore) and better tool is available too.

    MicroStation BASIC was replaced by MicroStation VBA when MicroStation V8.0 was released in 2001 (17 years ago) and marked as obsolete in V8 2004 Edition I guess (14 years ago). MicroStation BASIC history ended with CONNECT Edition more than 2 years ago, because it was removed from the product.

    "Obsolete" means the tool is still avilable, but not developed further (and usually less supported) and no new project should be based on such tool. So to recommend BASIC after 14 years when Bentley have told "don't use it and migrate your macros to VBA" and this technology is effectively dead for more than 2 years is really as Jon wrote the navigating people to the quicksands of 20th century technology.

    because  its what I know better as I'm a drafter and  NOT a coder

    I don't see any relevance to be not programmer (e.g. drafter) and to prefer MicroStation BASIC. In fact I think it's even opposite: MicroStation BASIC as proprietary technology has limited documentation with really limited base of tutorials and examples. Contrary to it, VBA is broadly used tool, the same over all SW as Office etc, so there are hundreds of sources (book, tutorials, examples...) and to start with VBA is quite easy, because the learning curve can begin with Office VBA (because of the most tutorials) and later MicroStation VBA API can be added. Also tools (editor, object browser, debugger) are far better.

    I am pretty sure also here in dicussion groups there are substantially more people knowing VBA than MicroStation BASIC.

    Regards,

      Jan

  • Your quite right Jan , but I only suggested to Richard offline to try  Basic after he already tried everything else including  vba to try to FIND A KEY IN COMMAND... and had exhausted all the other possibilities ie  as last resort not a first resort... even though I told him to do a search here as I remember there was a vba execute keyin...

    If your company  doesn't pay for select support then contacts and this forum are pretty much your only way to find out how to do something...

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me