Modify Working Unit Settings via VBA or Key-in

MicroStation V8i (SELECTseries 3)

I have to change Format on a number of .dgn file from MU:SU:PU to Std MU and the Accuracy to 0.1234 or 0.0000, I figure there is either a VBA command (not finding) or

a super Key-in command. I asked the question a few various ways did not read any examples I needed. I saw a comment on the "tcb-> command and on MDL ......  nothing.

appeared it was for the above. I also found this command: 

Sub Accuracy4()
' 122113 Drawing Accuracy setting, TEST
ActiveSettings.CoordinateAccuracy = msdAccuracy4
CadInputQueue.SendKeyin "m,ms Set Accuracy 0.0001"
End Sub

Did not seem to do anything. Can someone help me on this?

Parents
  • Clarification : the Accuracy4  will change the 0.12  to  0.1234, I had failed to load the VBA after puting it in. I went Back and It works, Sorry

    So If someone knows the command for changing MU:SU:PU to just MU I am good, unless there is a Key-in for the Accuracy also.

    Version: MicroStation V8i SS 10

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

  • Hi Richard,

    a couple of comments:

    I figure there is either a VBA command (not finding)

    How to modify working units using VBA code was discussed several times already, search for these discussions.

    BTW it's questionable whether "VBA command" is correct terminology, there are MicroStation key-ins and VBA code, but VBA command?

    or a super Key-in command.

    There is nothing like "super Key-in command" in MicroStation. Again, it's about proper terminology, and MicroStation has key-ins.

    I have to change Format on a number of .dgn file from MU:SU:PU to Std MU and the Accuracy to 0.1234 or 0.0000,

    Working units are always set for model, not dgn file. So it's always good to specify whether there can be more models in dgn file(s), so the same code (or key-in) has to be used for individual models, or there is always one (default) model only.

    I saw a comment on the "tcb-> command

    It seems to me you try to do very simple thing in extremely complicated way. As I wrote above, it's was discussed several times already. e.g. here.

    I also found this command:

    Maybe it works, but it's completely wrong approach in my opinion.

    What about to use simple VBA code:

    ActiveSettings.CoordinateFormat = <MsdCoordinateFormat>
    ActiveSettings.CoordinateAccuracy = <MsdCoordinateAccuracy>
    

    See MicroStation VBA documentation for values of MsdCoordinateAccuracy and MsdCoordinateFormat values.

    In your case, they probably will be

    ActiveSettings.CoordinateFormat = msdMasterUnits
    ActiveSettings.CoordinateAccuracy = msdAccuracy4

    And when used as key-ins:

    vba execute ActiveSettings.CoordinateFormat = msdMasterUnits
    vba execute ActiveSettings.CoordinateAccuracy = msdAccuracy4

    But as I wrote already, everything was discussed in the past...

    With regards,

      Jan

  • Again my hat is off to you. Terminology is paramount and I am learning the terms. as you stated they are needed. As to the super key-in, I do know they are key-ins the Super was my poor approach at using a 

    superlative to express my opinion of the Key-ins tool (it is super to me) itself, sorry for that. I only work-in 1 view, I always just turn off all the others. if that is an answer to the default mode ? I really do want the simple way, but when I see something that may work, I am ignorant (no kidding !!! Joke I am) on simple or hard. It seems I do not know the correct structure to search the question you refer to . I put a few ways in help and on line. thumbs down to my question ability. Even in goggle I try a number of ways and sometime due to do you mean .........  and a different way to ask question is recommended. So Thank you for the answer Jan and if you are willing I would love to see, learn and use the simple way. Thank you Richard

    Jan if you will type the question, for me to read, I will do the work to search and read, but I am asking wrong, due to the terms of cod, keyins and the names I use (incorrect) commands and Key-in. I am trying to learn and you appear from reading some of your reply to others are

    top knowledge, but maybe no to tolerant with rookies like myself. I did design PLC controls, but as electrician using Ladder Logic

    I was able to do that. Designed the entire flour system from the silo's to the Bread, Buns and Honey Bun Mixers. I designed, wired and phased into service. All self-trouble shooting down to which switch and which direction it failed Extended or retracted and which fuse was blown and its location. I did drawings in AutoCad bare bones, all manual. Different fields. Your knowledge is valuable here, mine is nothing but a memory of the past. 2009 was my last year of 33 for Wonder. NO wonder I do not know Hahaha  God bless and thank you again.

    Version: MicroStation V8i SS 10

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

  • Jan, I found this statement:

    For all possible values of accuracy constant,
    see MsdCoordinateAccuracy
    Type description in MicroStation VBA help
    (delivered with all MicroStation installations).

    I opend VBA, and then the help. I typed in the following

    msdcoordinteAccuracy and I must have misunderstood something because this is what I got.

    I was hoping to find all the various code  you know for many of the items listed in Settings>Design File>

    some seem to have key-ins like KY= <VALUE>

    seems every drawing I get it is a 1 and the 2 works so much better. I also like to set the two colors

    for element highlight and Selection color, a quick Key-in or V code, I was using the term command because I was reading the statements or Code 

    and many say : CadInputQueue.SendCommand  or CommandState.StartDefaultCommand Another error, I do want to learn the proper terms to converse and ask questions correct. I do search, as I have head others do. I was told once use goggle it works better ? I need to try that with these commands or code. As always thank you for any help.

    Version: MicroStation V8i SS 10

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

  • I must have misunderstood something because this is what I got.

    You opened VBA help file, not MicroStation VBA help. There are two different chm files!

    Regards,

      Jan

  • Jan, so hate to ask, I know how to open help F1, or I know how to open VBA project manager>open visual basic editor and then the help. But do not know how to load or open the Microstation VBA help. Is is possible you would tell me or give me a link. I have been checking ?  I even did a search on the communities > Search and put in 

    for sure I am missing something. Any other information you would pass on?

    Version: MicroStation V8i SS 10

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

Reply
  • Jan, so hate to ask, I know how to open help F1, or I know how to open VBA project manager>open visual basic editor and then the help. But do not know how to load or open the Microstation VBA help. Is is possible you would tell me or give me a link. I have been checking ?  I even did a search on the communities > Search and put in 

    for sure I am missing something. Any other information you would pass on?

    Version: MicroStation V8i SS 10

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

Children