Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to implement the Revit Entitlement API. And trying to apply the Entitlement OnStartup.
However it seems that I need to set Autodesk.Revit.ApplicationServices.Application.
How can I set Autodesk.Revit.ApplicationServices.Application at the OnStartup Event? It seems I can't get from Autodesk.Revit.UI.UIControlledApplication to Autodesk.Revit.ApplicationServices.Application.
I can get it using ExternalCommandData, however I don't have access to this OnStartup?
Dim rvtApp As Application = uiApp.Application 'Check to see if the user is logged in. If Not Application.IsLoggedIn Then TaskDialog.Show("Entitlement API", "Please login to Autodesk 360 first" & vbLf) Return False End If Dim userId As String = rvtApp.LoginUserId Dim isValid As Boolean = Entitlement(app.appId, userId) Dim msg As String = (Convert.ToString((Convert.ToString("userId = ") & userId) + vbLf & "appId = ") & app.appId) + vbLf & "isValid = " + isValid.ToString() If isValid Then TaskDialog.Show("Entitlement API", msg) Return True Else TaskDialog.Show("Entitlement API", msg) Return False End If
Kind Regards
David
Solved! Go to Solution.