0

It remains unclear to me, how a Revit addin would know if there are other active local files (other active users) at runtime.

The plugin under consideration needs to provide all scheduled elements with their UniqueID in a shared parameter ‘SPuniqueID’ . The purpose being that this SPuniqueID can then be added to the schedule (it is a pity that it is not possible to add the UniqueID directly to the schedule via the Revit userinterface).

Next, the schedules, with field SPuniqueID added to the schedule, can then be exported to excel. Because SPuniqueID, containing the UniqueID, is added to the excel table, it is possible to then write a ScheduleCompare program, to compare 2 quantity surveys, generated on different moments in the lifetime of the revit project and find the differences (quantities that have changed for certain articles).

I already built this ExportSchedules plugin to work flawless on a standalone revit file, working even with linked elements from revit links. When I run this on a local copy of a central model however, I get of course an exception that some elements are borrowed by other users and that the SPuniqueID can’t be set.

I want to check beforehand if I have full rights on all the scheduled elements. Is ‘WorksharingUtils.CheckoutElements()’ operating on the list of scheduled elements and catch exceptions, the only way to accomplish this?

I thought there maybe was a log file somewhere that would track the active local users. If and only if this list contains only my name, I would let the plugin proceed, because I would then automatically know all the elements are available for editing.

Kind regards

Paulus

  • c.f. also http://forums.autodesk.com/t5/revit-api/worksharing-get-active-local-users/td-p/5888747 – Jeremy Tammik Nov 02 '15 at 19:49
  • Have you checked out the Document.HasAllChangesFromCentral() method? It may work, but I suspect it doesn't report when other users have elements borrowed in their local files, but have not synchronized those changes to central. – Colin Stark Nov 03 '15 at 06:55
  • Thanks for your answer cs1088. Howerver I don't need to know if my local file is up to date. I know I am up to date, because I sync with CM, before I export a quantity survey. As you mention, I need to know if other users are still active and working. They shouldn't, not when a quantity survey is being made. – Paulus Present Nov 03 '15 at 20:32

1 Answers1

0

Paulus, Check out the WorksharingUtils.GetCheckoutStatus() method - it can tell you whether the element is checked out, and if so which user.

Beyond that, the only other place to go is by monitoring the SLOG file in the Central File folder (but - yuck!).

Best Regards, Matt

Matt
  • 1,043
  • 5
  • 8
  • Thanks for your answer Matt. Indeed, the WorksharingUtils.GetCheckoutStatus() method would serve my purpose more directly then WorksharingUtils.CheckoutElements() and catching exceptions. – Paulus Present Nov 03 '15 at 20:12
  • For a large project (el 100000+), I suspect this to be an intensive process. It would be faster to phone and ask every local user to sync and stay away for 5 min while the ExportSchedules addin runs. Typically this command only has to be used once every so often. Moreover, when you make an official quantity survey of a project you don't want any other local users to be still adding elements while the command is running. So maybe it just makes sense in this case to just call everyone and ask them to shut down, rather then iterating through all the elements to get a list of active users. – Paulus Present Nov 03 '15 at 20:27
  • I thought maybe Revit kept a API reachable list somewhere of the active users... It would be much easier. All this in the first place because Element.UniqueID cannot be set as a Revit parameter in a Revit schedule. – Paulus Present Nov 03 '15 at 20:28
  • Paulus, you could also explore other ways of exporting schedules to excel, so that you didn't need to duplicate the uniqueid into a parameter. There are a wide variety of products that do that, or you could write your own- just to get around that requirement. – Matt Nov 03 '15 at 22:00
  • Thanks Matt, I will keep my eyes open :) – Paulus Present Nov 05 '15 at 09:43