×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

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!

*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

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! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close