Design File change Mil to inches via VBA

I have searched , worked from 3am to 7:11am trying to figure out how to change the Master Unit to inches via VBA command and the Sub Unit to inches

I tried to figure out how to use the ActiveModelReference.UORsPerMasterUnit, I tried goggling it, I finally got it via a key-in command. Seems sloppy

most of the information I have from Jan S and Jon S, but never need to change from inches to mil and back. I feel sure it is out there but I ran out of ideas for searching

the answer. I have some notes in the VBA Macro that I am going to save in my Micro Station Word document. We know it can be done manually, but I am now in a series of drawings that I am having to change the Design File and wanted to automate. I have 1 already for the standard setup, but the unit was never the issue. I also tried a message to Yongan. Fu

who had sent me a link that was helpful. I hope someone will have mercy on me and give me the VBA way.

Sub SetWorkingUnitsFractional()           '

'   081620 - This sets the Units and Accuracy in Decimal, if you go to 12 it sets 64ths fractional
'    Never could figure 0ut how to do all in VBA had to use Key-in spen hours on this.
    '   Start a command
     Dim MyUnit As MeasurementUnit
     MyUnit.System = msdMeasurementSystemEnglish         'this was a tip I read ?
     ActiveSettings.CoordinateFormat = msdMasterUnits       'Causes Only MU to be on
     'ActiveSettings.CoordinateFormat = msdSubUnits          'Causes MU:SU to come on
     'ActiveSettings.CoordinateFormat = msdMasterUnits      'Causes MU:SU:PU to come on
'     ActiveSettings
    CadInputQueue.SendCommand "set units inches"
    ActiveSettings.CoordinateAccuracy = msdAccuracy64th
    'ActiveModelReference.UORsPerMasterUnit = inches             ' Failed attempt
  ShowStatus "Accuracy 1/64"
End Sub

Parents Reply Children
No Data