Macro to obtain a Shareable Product (Step License)
Macro to obtain a Shareable Product (Step License)
(OP)
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





RE: Macro to obtain a Shareable Product (Step License)
What is not working ? You cannot get the license ? Is it a license available ?
A very good article about this subject you can find on Mike Berry blog - v5vb.wordpress.com (use search function for license).
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Macro to obtain a Shareable Product (Step License)
We have a few shareable products that once you are in catia you can Tools>Options>Shareable Products.
Then we need to scroll thru the list to grab the step license (ST1).
Typically at work each one of us uses the step license a few times a day, and this becomes a repeatative task to obtain and release.
I would like a macro that does exactly that, in which I will assign a button or short cut to.
In addition to above, I have tried to dump the parameters with and without the shareable license selected, and also recorded a macro. In which neither recorded what was needed.
Thanks,
Rick
RE: Macro to obtain a Shareable Product (Step License)
I have looked at Mike's post. His function will check to see if you have a specified dynamic license, then if false, it will tell you to get it.
I am looking for one that will simply obtain a specified dynamic license.
Thanks,
Rick