Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 518

Entitlement API in Inventor 2018

$
0
0

By Chandra shekar Gopal

Entitlement API are used in getting Autodesk 360 users account information. It also helps in determining genuinely of users. Whether the user is downloaded from App Store or copied from somewhere else.

In previous version of Inventor (2016 & 2017), Entitlement API is provided by AdWebServices.dll and is in C++. It is explained in this post.

In Inventor 2018, Entitlement API is provided by a .net Wrapper called "AddinNETFramework.AdWebServicesWrapper.dll"

The .net Wrapper is available at installed location (C:\Program Files\Autodesk\Inventor 2018\Bin)

So, in order to access Entitlement API, AddReference "AddinNETFramework.AdWebServicesWrapper.dll" from installed location to the application.

Sample C# code.

using Autodesk.WebServices;


CWebServicesManager mgr = new CWebServicesManager();

bool isInitialize = mgr.Initialize();

if (isInitialize == true)
{

   string userId = "";

   mgr.GetUserId(ref userId);

   string username = "";

   mgr.GetLoginUserName(ref username);

}

Sample VB.net code.

Imports Autodesk.WebServices


Dim webServiceMgr As CWebServicesManager

webServiceMgr = New CWebServicesManager()

Dim isWebServiceInitialized As Boolean

isWebServiceInitialized = webServiceMgr.Initialize()

If isWebServiceInitialized = True Then


    Dim userId As String = "" webService

    Mgr.GetUserId(userId)

    Dim userName As String = "" webService

    Mgr.GetLoginUserName(userName)


End If


Viewing all articles
Browse latest Browse all 518

Trending Articles