metipradeep
Aerospace
thread560-328286
Hi Ferdo,
Below is the CATScript, given by you to toggle between the units,
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#, 3#
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#, 3#
oUnitsSheetSettingAtt.SaveRepositoryForUnits()
oUnitsSheetSettingAtt.CommitForUnits()
oUnitsSheetSettingAtt.Commit()
MsgBox "The Current Unit is now: " & oUnitMM
End If
CATIA.StartCommand "Options"
End Sub
I am getting a error trying to run it, please see attachment.
Please help.
Thanks for your time.
Hi Ferdo,
Below is the CATScript, given by you to toggle between the units,
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#, 3#
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#, 3#
oUnitsSheetSettingAtt.SaveRepositoryForUnits()
oUnitsSheetSettingAtt.CommitForUnits()
oUnitsSheetSettingAtt.Commit()
MsgBox "The Current Unit is now: " & oUnitMM
End If
CATIA.StartCommand "Options"
End Sub
I am getting a error trying to run it, please see attachment.
Please help.
Thanks for your time.