I am planning to convert files from International Feet to U.S. Survey feet using a simple VBA macro. I can change the Working Units and Storage Units with no problem:
CadInputQueue.SendKeyin ("set units ""US Survey Feet"" ""US Survey Inches"" ")CadInputQueue.SendKeyin ("set storageunit US Survey Foot")
However, I cannot change the MU and SU labels in my MVBA code.
Is there any way I can accomplish this in my code?
Running MicroStation CE 10.10.00.23
The following VBA code works for me.
CadInputQueue.SendKeyin "set units ""US Survey Feet"" ""US Survey Inches"""
CadInputQueue.SendKeyin "SET STORAGEUNIT US Survey Foot"
Have a look at the units definition fileC:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\Default\Data\Units.def
Thank you, Leonard. How about your unit labels. Your VBA is setting them to SF and SI. Do you have code that set them to ' and "?
Warren J. MalveauSenior CADD Support SpecialistLos Angeles County Sanitation Districts
Warren Malveau said:Do you have code that set them to ' and "
Please clarify what you are asking. Leonard's response seems to match your requirement, stated in your first post.
Regards, Jon Summers LA Solutions
That code sets the actual units to survey feet, but it doesn't change the way the units will be labeled (in dimensions and measurements). The Survey Feet units will be labeled with SF (as in 100SF) but I believe the OP is looking to change that label to ' (as in 100').
Power GeoPak 08.11.09.918Power InRoads 08.11.09.918OpenRoads Designer 2021 R2
MaryB said:I believe the OP is looking to change that label to ' (as in 100').
Thanks! We metric folks get confused easily.
I think that Leonard's suggestion about the Units.def file may be promising. Here are two relevant extracts...
# Label:# Used to specify the default label for coordinate readout and dimensioning. A list of# labels can be provided but only the first is used by V8. The other labels are used# when loading a V7 format file, in which case the label for the V7 file's master unit# will be matched against all the labels that are provided.
si,in,"; _[SYSTEM]_; _[SYSTEM]_; 39370.0; 1000.0;1; 3#US Survey Inches
sf,ft,'; _[SYSTEM]_; _[SYSTEM]_; 39370.0; 12000.0;1; 3#US Survey Feet
If I've understood that description, then by changing the order of the comma-separated labels the OP should achieve his goal...
",si,in; _[SYSTEM]_; _[SYSTEM]_; 39370.0; 1000.0;1; 3#US Survey Inches
',sf,ft; _[SYSTEM]_; _[SYSTEM]_; 39370.0; 12000.0;1; 3#US Survey Feet
It's worth a try and involves no programming.
Answer Verified By: Robert Hook
Changing the order of the labels in UNITS.DEF is the way to go. Works perfectly!