Track number of clicks per project

Track number of clicks per project

skyeg321
Collaborator Collaborator
857 Views
5 Replies
Message 1 of 6

Track number of clicks per project

skyeg321
Collaborator
Collaborator

Hey guys I'm a brand new baby developer learning C#. I'm trying to make a standalone app (not add-in) that tracks the number of clicks per Revit project. Right now I'm tracking the number of clicks my computer makes but its not specific to Revit. How do I do this and where do I look next time to see what the api can deliver to me? Thank you!

0 Likes
Accepted solutions (1)
858 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

Welcome to the Revit API!

 

Unfortunately, it cannot be used at all in a stand-alone context.

 

The Revit API supports pure .NET add-in development and nothing else.

 

It is completely event driven. You cannot use the Revit API except in a valid Revit API context. Such a context is provided by the Revit event, and nowhere else.

 

So, if you are totally committed to stand-alone programming only, you can say goodbye to the Revit API.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 6

skyeg321
Collaborator
Collaborator

Ok interesting. The reason we made an external application is because the revit api doesnt return mouse clicks (right?) So is there a way to do an add-in also then make the two programs both start together and talk to each other? 

0 Likes
Message 4 of 6

jeremytammik
Autodesk
Autodesk
Accepted solution

You can connect any two applications you like using IPC:

 

https://en.wikipedia.org/wiki/Inter-process_communication

 

That includes your external stand-alone executable and a Revit .NET add-in DLL.

  

However, I can confirm that the Revit API does not really provide a useful method for tracking individual clicks on an element.

  

One thing that it can track and supply information on is modifications of an element, in case that is of use to you.

   



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 6

skyeg321
Collaborator
Collaborator

OK I’m just looking to keep track of the total clicks per project so as long as Revit knows what project it’s in (or project folder) and I can get the number of clicks from the external app then it should work! Thank you.

0 Likes
Message 6 of 6

Anonymous
Not applicable

Assuming this is for a single user on a PC running Windows, I would build a simple .NET app that utilizes the native Win32 API to simply check if the Revit UI window is the active window. If/When it is, capture all mouse and keyboard I/O.

 

 

0 Likes