Revit Maintaining ExternalApplication Status

Revit Maintaining ExternalApplication Status

Anonymous
Not applicable
629 Views
4 Replies
Message 1 of 5

Revit Maintaining ExternalApplication Status

Anonymous
Not applicable
I working on sample login application in Revit 
 
Requirement: 
- Revit tab has two Push-buttons, Login and upload
- Login: Opens a window form where one can enter username and password and get validated from API.
 
  I have created ExternalCommand for this login(dll) and hooked it in ExternalApplication. 
  Now, how can I keep track of logged in status, so that next time he don't have to login again?
- Also depending the logged in status I have to enable/disable upload  
0 Likes
Accepted solutions (1)
630 Views
4 Replies
Replies (4)
Message 2 of 5

matthew_taylor
Advisor
Advisor

Hi @Anonymous,

You need to look at IExternalCommandAvailability for enable/disable.

As for retaining login status? Depends on the scope. Forever = file or registry. Revit session = application singleton property. Document = parameter or extensible storage. Lots of possibilities.

 


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 3 of 5

Anonymous
Not applicable

Thanks for your reply,

The scope I'm looking for is 'Forever', I'm new to plugin development; can you please point me towards how I can achieve this.

 

Thanks again

 

0 Likes
Message 4 of 5

matthew_taylor
Advisor
Advisor
Accepted solution

Hi @Anonymous,

You probably want to use the Registry then. (Well, it's a relatively easy way, at least!)

This link gives tips:

http://www.c-sharpcorner.com/UploadFile/f9f215/windows-registry/

You will likely need to read/write to the CurrentUser/HKEY_CURRENT_USER branch.

Stay away from deleting anything until you are *sure* what you are doing.

RegEdit is a good way to manually check/edit the registry, and also allows you to back it up.


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 5 of 5

Anonymous
Not applicable

Thank you for the Answer 🙂

0 Likes