×
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 load license

Macro to load license

Macro to load license

(OP)
Hi,
I often charge a license in 'shareable products' such as the SPA license.
How do I create a button to activate / deactivate a license?

thanks

RE: Macro to load license

Hi,

CODE --> CATScript

Language="VBSCRIPT"

Sub CATMain()

Dim settingControllers1 As SettingControllers
Set settingControllers1 = CATIA.SettingControllers

Dim memoryWarningSettingAtt1 As SettingController
Set memoryWarningSettingAtt1 = settingControllers1.Item("CATSysMemoryWarningSettingCtrl")

Dim licenseSettingAtt1 As SettingController
Set licenseSettingAtt1 = settingControllers1.Item("CATSysLicenseSettingCtrl")

  Dim Message, Style, Title, Response, SecString
    Message = ("To get the SPA license click YES, to release it click NO" ) 
    Style = vbYesNo + vbDefaultButton1    'Define default button
    Title = "Purpose : change status of a specific license "   
    Response = MsgBox(Message, Style, Title)
If Response = vbYes Then    ' User chose Yes.
        
Dim generalSessionSettingAtt1 As SettingController        
Dim disconnectionSettingAtt1 As SettingController

''''''''''''''''''YES
licenseSettingAtt1.SetLicense "SPA.prd", "SPA.prd"
Set generalSessionSettingAtt1 = settingControllers1.Item("CATCafGeneralSessionSettingCtrl")

generalSessionSettingAtt1.SaveRepository 
Set disconnectionSettingAtt1 = settingControllers1.Item("CATSysDisconnectionSettingCtrl")

disconnectionSettingAtt1.SaveRepository 
memoryWarningSettingAtt1.SaveRepository 
licenseSettingAtt1.SaveRepository 

Else
''''''''''''''''''''''''NO
licenseSettingAtt1.SetLicense "SPA.prd", "NotRequested"
Set generalSessionSettingAtt1 = settingControllers1.Item("CATCafGeneralSessionSettingCtrl")

generalSessionSettingAtt1.SaveRepository 
Set disconnectionSettingAtt1 = settingControllers1.Item("CATSysDisconnectionSettingCtrl")

disconnectionSettingAtt1.SaveRepository 
memoryWarningSettingAtt1.SaveRepository 
licenseSettingAtt1.SaveRepository 

End If

End Sub 

Regards
Fernando

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: Macro to load license

Do you have to fix the code if the license is on another server? I tried to run this macro at my job and indicated an error on this line:

licenseSettingAtt1.SetLicense "SPA.prd", "SPA.prd"

that license is available (manually).

RE: Macro to load license

(OP)
Hi Ferdo,
do you have some news?

thanks

RE: Macro to load license

Biricio,
Any luck on getting this to work?
I have been unsuccessful trying to get the same thing to work for our Sharable Products.

Thanks

RE: Macro to load license

(OP)
No, unfortunately Ferdo has not responded.
I would like to have a button to activate / deactivate a Sharable Products.

Ferdo where are you? We are waiting you.

RE: Macro to load license

CATIA doc referes to CATSysLicenseSettingCtrl for Licensing and CATSysDynLicenseSettingCtrlfor shareable product

I let you pout A and B togeteher

Eric N.
indocti discant et ament meminisse periti

RE: Macro to load license

(OP)
I have tried to put CATSysDynLicenseSettingCtrl instead of CATSysLicenseSettingCtrl...but nothing.
bye

RE: Macro to load license

Biricio,
FYI I tried the same, did not work for me.

RE: Macro to load license

(OP)
FERDO, do you have any news?
bye

RE: Macro to load license

(OP)
Hi Ferdo,
we can resume the subject.
Can you do some testing?

I really really need this macro
thanks

RE: Macro to load license

Do you require that Catia be open for this change to be made?

RE: Macro to load license

Garzar,
I believe that I am looking for the same macro as biricio.
Catia would be open.
Run a macro to select/deselect a sharable license such as step(ST1) or space analysis(SPA).

Thanks,
Rick

RE: Macro to load license

We done this a number of ways with Catia closed.
I have had no consistent success in doing this with Catia open.

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