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

  • 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

  • What happens if you use the keyin

    vba run ActiveSettings.CoordinateAccuracy=msdAccuracy3

    ?

    Programs can be notoriously picky about the phrasing of things

    MaryB

    Power GeoPak 08.11.09.918
    Power InRoads 08.11.09.918
    OpenRoads Designer 2021 R2

        

  • Hi,

    Unknown said:
    point me to the answer if anyone knows

    I am surprised this question has returned again and again regardless correct key-in was mentioned already in this discussion and also wrong anwers were identified also.

    As you mentioned and confirmed, to even think about BASIC today is completely wrong direction.

    is pretty close to correct answer, but still one mistake has to be corrected.

    Unknown said:
    I am not able to put ActiveSettings.CoordinateAccuracy = {number}

    Yes, because it's wrong.

    The correct key-in is

    vba execute ActiveSettings.CoordinateAccuracy = <constant>

    for example

    vba execute ActiveSettings.CoordinateAccuracy = msdAccuracy5

    Using VBA editor gives you list of all available constans:

    Also Object Browser in VBA Editor can help to identify correct values:

    With regards,

      Jan

Reply Children
  • Jan So sorry , I lost where this question was, I just found your link earlier, very sorry and  I think Number is sorta like  <Constant> ?

    I am coping your answers into a text file before going off, I over looked the lets you look below, so I never saw any of these replays

    just saw the one from Lorys. A really great, patient, helpful person on here. I read a lot of his kindness to many on here.

    He seems to put his heart into helping others as a number of you all do too!! Keep on helping us old slow guys with diminishing minds and bodies. I just book marked this now, could not find my way back till Jan helped me out. please believe I do like simple

    God Bless all for being kind and helpful

    Version: MicroStation V8i SS 10

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

  • Thank you made a copy, did not know of the Object Browser. I have clipped a number of Goggle searches with replies from L.A. Solutions. He is very knowledgeable also. Well now aproaching 4:00 am, gotta quit. Many thanks to anyone willing to assist.

    Version: MicroStation V8i SS 10

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