Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to obtain a Shareable Product (Step License)

Status
Not open for further replies.

rickyt

Automotive
Jun 26, 2002
233
US
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
 
Replies continue below

Recommended for you

Ferdo,
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
 
Ferdo,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor