I have searched all over trying to find a macro that will obtain a shareable license.
I have found 4 different scripts online but none of them work for me.
Any sugestions?
Here are the 4 that I have found:
1.)
Language="VBSCRIPT"
Sub CATMain()
'Dim settingControllers1 As SettingControllers
Set settingControllers1 = CATIA.SettingControllers
'Dim dynLicenseSettingAtt1 As DynLicenseSettingAtt
Set dynLicenseSettingAtt1 = settingControllers1.Item("CATSysDynLicenseSettingCtrl")
' Call
dynLicenseSettingAtt1.SetLicense("ST1.prd", "ST1.prd")
dynLicenseSettingAtt1.SaveRepository
dynLicenseSettingAtt1.Commit
End Sub
2.)
Sub CATMain()
Dim SettingController, DynLicenseSettingAtt
Set settingController = CATIA.SettingControllers
Set DynLicenseSettingAtt = SettingController.Item("CATSysDynLicenseSettingCtrl")
DynLicenseSettingAtt.SetLicenseLock "ST1.prd",True
End Sub
3.)
Sub CATMain()
Dim settingControllers1 As SettingControllers
Set settingControllers1 = CATIA.SettingControllers
Dim DynLicenseSettingAtt As DynLicenseSettingAtt
Set DynLicenseSettingAtt = settingControllers1.Item("CATSysDynLicenseSettingCtrl")
Dim bstr12 As String
bstr12 = DynLicenseSettingAtt.GetLicense("ST1.prd")
DynLicenseSettingAtt.SetLicense "ST1.prd", "Requested"
DynLicenseSettingAtt.SaveRepository
End Sub
4.)
Language="VBSCRIPT"
Sub CATMain()
Set settingControllers1 = CATIA.SettingControllers
Set dynLicenseSettingAtt1 = settingControllers1.Item("CATSysDynLicenseSettingCtrl")
'Dim array1
'array1 = dynLicenseSettingAtt1.GetLicensesListInfo()
'--------------------------------------------------
' Returned value : (Array)
'--------------------------------------------------
'Dim bSTR1
'bSTR1 = "ST1"
'Dim bSTR2
'bSTR2 = "locked"
'Dim boolean1
'boolean1 = dynLicenseSettingAtt1.GetLicensesListInfo(bSTR1, bSTR2)
'--------------------------------------------------
' Parameter 1 : (String) "Default value"
' Parameter 2 : (String) "Unlocked"
' Returned value : (Boolean) False
'--------------------------------------------------
SetLicenseLock = st1.prd(locked)
End Sub
I have found 4 different scripts online but none of them work for me.
Any sugestions?
Here are the 4 that I have found:
1.)
Language="VBSCRIPT"
Sub CATMain()
'Dim settingControllers1 As SettingControllers
Set settingControllers1 = CATIA.SettingControllers
'Dim dynLicenseSettingAtt1 As DynLicenseSettingAtt
Set dynLicenseSettingAtt1 = settingControllers1.Item("CATSysDynLicenseSettingCtrl")
' Call
dynLicenseSettingAtt1.SetLicense("ST1.prd", "ST1.prd")
dynLicenseSettingAtt1.SaveRepository
dynLicenseSettingAtt1.Commit
End Sub
2.)
Sub CATMain()
Dim SettingController, DynLicenseSettingAtt
Set settingController = CATIA.SettingControllers
Set DynLicenseSettingAtt = SettingController.Item("CATSysDynLicenseSettingCtrl")
DynLicenseSettingAtt.SetLicenseLock "ST1.prd",True
End Sub
3.)
Sub CATMain()
Dim settingControllers1 As SettingControllers
Set settingControllers1 = CATIA.SettingControllers
Dim DynLicenseSettingAtt As DynLicenseSettingAtt
Set DynLicenseSettingAtt = settingControllers1.Item("CATSysDynLicenseSettingCtrl")
Dim bstr12 As String
bstr12 = DynLicenseSettingAtt.GetLicense("ST1.prd")
DynLicenseSettingAtt.SetLicense "ST1.prd", "Requested"
DynLicenseSettingAtt.SaveRepository
End Sub
4.)
Language="VBSCRIPT"
Sub CATMain()
Set settingControllers1 = CATIA.SettingControllers
Set dynLicenseSettingAtt1 = settingControllers1.Item("CATSysDynLicenseSettingCtrl")
'Dim array1
'array1 = dynLicenseSettingAtt1.GetLicensesListInfo()
'--------------------------------------------------
' Returned value : (Array)
'--------------------------------------------------
'Dim bSTR1
'bSTR1 = "ST1"
'Dim bSTR2
'bSTR2 = "locked"
'Dim boolean1
'boolean1 = dynLicenseSettingAtt1.GetLicensesListInfo(bSTR1, bSTR2)
'--------------------------------------------------
' Parameter 1 : (String) "Default value"
' Parameter 2 : (String) "Unlocked"
' Returned value : (Boolean) False
'--------------------------------------------------
SetLicenseLock = st1.prd(locked)
End Sub