Example for External Events to Save the Project from c#

Anonymous

Example for External Events to Save the Project from c#

Anonymous
Not applicable

 Dear ADN team,

 

I need to save the opened files on Revit from C# itself without going to it.

 

For that I made some googling and found 'External events' are best suit to it. So I've been searching for the sample application for this,

 

And found one named 'RevitWebCam' which having some syntax errors also. But I believe it might be either due to the version compatibility or I'm missing any steps to execute.

 

Can someone send me a sample application for 'Saving' the revit application and the exact way to execute this.? 

 

Note: I'm using Revit 2016, Saving alone is enough for me.

 

 

Regards,

Jayahar

 

Reply
658 Views
2 Replies
Replies (2)

arnostlobel
Alumni
Alumni
Dear Jayahar,


can you please explain what exactly you meant by the following sentence:


"I need to save the opened files on Revit from C# itself without going to it."


particularly, what does it mean "...without going to it"? What is that "it"?


>From what you say, if all you want is save opened Revit files, you do not need an External Event at all. External events are to allow interfacing with Revit from external threads and modeless dialogs (which are on other threads also). That all they are for;


Thanks



Arnost Löbel

Sr. Principal Developer

Autodesk Revit R&D
Arnošt Löbel
0 Likes

Anonymous
Not applicable

Dear Arnost Löbel,

 

At first, Thanks for the reply. Please read below:

 

My requirement is to save and close the opened Revit files from C# when Revit is idle for few minutes. I can get the idle time processing from User32.dll and its done with that(It works for any application not only to Revit). 

 

Example, UserA is woked on Revit and forget to close it, so that license usage is keep on active on server. So another user might not able to open the application when licenses are fully used(Scenario: UserA might have purchased only one license but accessing on 2 machines).

 

Here, UserA is idle only, so better we can close the application without loss of data. If I can able to close the application after saving of all files. some other user can also make use of this limited license.

 

In this concept, the end user doesn't know or forget the application is idle for long time. So I can't expect him to look back into the revit and save & close by his own on the Revit.

 

For this, I need to save all opened files on Revit from C# alone with showing anything to enduser (not even a dialogbox)

For killing the application I can use Process.Kill() from C# application. But what about the 'Save'.?

 

For this kind of Save, I'm asking for 'ExternalEvents' or whatever the thing. 

 

If you think its possible in easy manner please guide me with any working example. I'm having Revit 2016 in my machine.

 

Hope you might get me what I'm pointing to. If you get any dificult to understand due to my bad english or with any reason, please let me know. So that I can more breifly.

 

 

Thanks,

Jayahar

 

 

 

0 Likes