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" 'CommandState.StartDefaultCommand End Sub
I do not see reason to answer again, when this issue was discussed and resolved many times (one from good discussions is e.g. here).
Please, when you ask for help, do not pollute the question with information not relevant to the main topic, it makes the question confusing and discouraging. Also, make you post easier to be read, so follow the best practices and use Insert > Insert code tool every time you share any piece of the code (even one line of VBA). I recommend to edit your post and to change it.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan, thank you for the reply, I have looked at those examples, I do not read it as you apparently do? not seeing an answer I understand. Thanks again.
CadInputQueue.SendCommand "set units inches"
Can this be done with ActiveSettings command ?
or the ActiveModelReference.UORsPerMasterUnit
Version: MicroStation V8i SS 10
RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus