×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Macro to obtain a Shareable Product (Step License)

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

RE: Macro to obtain a Shareable Product (Step License)

(OP)
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

RE: Macro to obtain a Shareable Product (Step License)

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources