Hello is there a way in CATIA where you can create a button that allows you to change quickly between metric and US units without having to go through the tools menu and options to change it every time?
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
Another option is to type in the units along with the value. This is quick and handy, if you only have a few numbers to convert on-the-fly.
For example; if the current units are set to MM, you could type in 2in, and CATIA will convert from inches to millimeters. I'm not sure of all the unit abbreviations, but you could also use "ft" pr "cm". There are many others.