Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a script file to check Entitlement.
When that comes back as true, I want it to launch the approved script.
I have tried 'subprocess' and 'runpy.' but it looks like they are trying to run outside of Fusion.
This is the entitlement code (sourced from Brian Ekins)
class CheckEntitlement(apper.Fusion360CommandBase):
def on_execute(self, command: adsk.core.Command, inputs: adsk.core.CommandInputs, args, input_values):
app = adsk.core.Application.get()
ui = app.userInterface
workSpace = ui.workspaces.itemById('FusionSolidEnvironment')
tbPanels = workSpace.toolbarPanels
global tbPanel
try:
userID = app.userId
appID = '2588623515668137326'
url = f'https://apps.autodesk.com/webservices/checkentitlement?userid={userID}&appid={appID}'
response = urllib.request.urlopen(url)
jsonb = response.read()
jsont = jsonb.decode("utf-8")
json_dict = json.loads(jsont)
if json_dict['IsValid']:
# ui.messageBox('The license is valid.')
tbPanel = tbPanels.itemById('Mold Tech')
if tbPanel:
tbPanel.deleteMe()
else:
ui.messageBox('License has Expired') # .\nMessage: ' + json_dict['Message'])
except:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Right after line 23 I want to launch the approved script.
The approved script is just code, no def or class modules.
Any help appreciated.
Brad Bylls
Solved! Go to Solution.