Question was about workbench, but anyway doesn't matter, ussualy peoples are asking about this to change in one click units from mm to in (or viceversa) for dimensions in drawings... I guess you want something else, check if is working properly for you (for me is OK in r18).
' ======================================================
' Purpose: Macro will toggle the current measure unit in an active CATIA session
' Usage: 1 - A CATIA session must exist
' 2 - Run macro
' Author: ferdo (Disclaimer: You use this code at your own risk)
' ======================================================
Language="VBSCRIPT"
Sub CATMain()
Dim oSettingControllers As SettingControllers
Set oSettingControllers = CATIA.SettingControllers
Dim oUnitsSheetSettingAtt As SettingController
Set oUnitsSheetSettingAtt = oSettingControllers.Item("CATLieUnitsSheetSettingCtrl")
Dim oMagnitude as String
oMagnitude = "LENGTH"
Dim oUnit as String
oUnit = ""
Dim oGetDecimal as Double
Dim oGetExpo as Double
oUnitsSheetSettingAtt.GetMagnitudeValues oMagnitude, oUnit, oGetDecimal, oGetExpo
If (oUnit = "Inch") Then
Dim oUnitInch as String
oUnitInch = "Millimeter"
oUnitsSheetSettingAtt.SetMagnitudeValues oMagnitude, oUnitInch, 6.000000, 3.000000
oUnitsSheetSettingAtt.SaveRepositoryForUnits()
oUnitsSheetSettingAtt.CommitForUnits()
oUnitsSheetSettingAtt.Commit()
MsgBox "The Current Unit is now: " & oUnitInch
End If
If (oUnit = "Millimeter") Then
Dim oUnitMM as String
oUnitMM = "Inch"
oUnitsSheetSettingAtt.SetMagnitudeValues oMagnitude, oUnitMM, 6.000000, 3.000000
oUnitsSheetSettingAtt.SaveRepositoryForUnits()
oUnitsSheetSettingAtt.CommitForUnits()
oUnitsSheetSettingAtt.Commit()
MsgBox "The Current Unit is now: " & oUnitMM
End If
CATIA.StartCommand "Options"
End Sub
Regards
Fernando