Is it possible that the "UserId" value returned by CWebServicesManager is empty?

Is it possible that the "UserId" value returned by CWebServicesManager is empty?

nagihan.bostan
Enthusiast Enthusiast
272 Views
3 Replies
Message 1 of 4

Is it possible that the "UserId" value returned by CWebServicesManager is empty?

nagihan.bostan
Enthusiast
Enthusiast

Is it possible that the "UserId" value returned by CWebServicesManager is empty or can be changed by the user?

 

 CWebServicesManager mgr = new CWebServicesManager();
                    bool isInitialized = mgr.Initialize();

                    if (isInitialized)
                    {
                        try
                        {
                            m_inventorApplication.Login();
                            string userId = "";
                            mgr.GetUserId(ref userId);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
0 Likes
273 Views
3 Replies
Replies (3)
Message 2 of 4

nagihan.bostan
Enthusiast
Enthusiast

Hi @HideoYamada,

I read your blog on this subject (https://qiita.com/yamarah/items/c7cd1ec7acc6e487d574), but since I don't know Japanese, I translated it from Google Translate.
As far as I understand, if the user is logged in to the autodesk product, there is no possibility of "UserId" being empty. Isn't this true?

 

0 Likes
Message 3 of 4

HideoYamada
Advisor
Advisor

Hi,

 


@nagihan.bostan wrote:


As far as I understand, if the user is logged in to the autodesk product, there is no possibility of "UserId" being empty. Isn't this true?


I believe it must be true.

Don't forget the codes must be run as Inventor's add-in.

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
Message 4 of 4

nagihan.bostan
Enthusiast
Enthusiast

Thanks for reply.

0 Likes