Worksharing - Get active local users

Worksharing - Get active local users

PaulusPresent_BB
Enthusiast Enthusiast
1,694 Views
5 Replies
Message 1 of 6

Worksharing - Get active local users

PaulusPresent_BB
Enthusiast
Enthusiast

Dear all

 

It remains unclear to me, how an 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

0 Likes
1,695 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

Dear Paulus,

 

Thank you for submitting this as a new discussion thread so we can all discuss and share this in public.

 

Here is an edited version of another thread on worksharing:

 

http://thebuildingcoder.typepad.com/blog/2015/02/extensible-storage-in-a-worksharing-environment.htm...

 

It also points to Scott Conover's Autodesk University 2013 class on making Revit add-ins that cooperate with worksharing, which might be helpful:

 

http://thebuildingcoder.typepad.com/blog/2014/10/worksharing-and-duplicating-element-geometry.html#2

 

Those are just about the only in-depth discussions related to worksharing that I am aware of.

 

Scott's AU session and the following roundtable discussion were very exiting back then.

 

I am passing your question on to the development team and hope they can help.

 

Best regards,

 

Jeremy



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

Message 3 of 6

Anonymous
Not applicable

@PaulusPresent_BB  It's been more than 4 years, hopefully you have figured this out, if not, here's how you get the active users in any project at any instance:

You can get the owner of each filtered elements and store the name string to the list which after you can extract the distinct items from. This way you can find out the name/ number of users, the workset they are working on, and elements.

Hope this helps!

 

Cheers!

Vishal Kelani

0 Likes
Message 4 of 6

jeremytammik
Autodesk
Autodesk

Dear Vishal,

 

Thank you for the helpful update. For you and other interested parties, Matt has provided some further useful guidance and discussed it further with Paulus in the StackOverflow question on the same topic:

 

http://stackoverflow.com/questions/33482665/revit-worksharing-get-active-local-users

 

Cheers,

 

Jeremy

 



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

0 Likes
Message 5 of 6

RPTHOMAS108
Mentor
Mentor

You are adding something to a Revit schedule and then exporting the Revit schedule to Excel.

 

Is it not possible to export the information to Excel directly i.e. then you are eliminating the borrowing of elements issue. At the moment you are writing a UID to a parameter on the element which requires you to borrow the element. If you are just reading the element information for direct extraction to Excel then I assume no borrowing occurs?

 

There have been various discussions on the suitability of Revit UniqueIDs as external database keys. I assume if creators of Revit were confident such Ids could be flawlessly used by an end user in such a way they would expose them. It would probably be a more robust solution if your write your own GUID to the element at point of element creation. Then you can have the debates as to when is the same column the same column i.e. when the user moves it across the site rather than create a column in the new location is it the same column? Then you end up going down the locational Id route.

0 Likes
Message 6 of 6

Anonymous
Not applicable

Dear Mr. Tammik,

 

Thank you for directing me to the thread. I agree with Matt, I just came across GetWorksharingTooltipInfo method while creating the program for data tracking, by which I can get the current owner, creator, and lastchangedby info for any element, I thought it was worth sharing if that serves Paulus' needs.

 

Thank you,

Vishal Kelani

0 Likes