Hello, is there a way to take ownership of an list of elements before running a script, actually inside the script?
the problem is sometimes scripts take a long time to run. maybe 1hr+ but then at the very end, when it tries to populated some data into the revit elements, Revit will say, so and so, owns the element, or the elements are not currently editable, or whatever other error messages. Because someone else probably has ownership of some of the elements you are trying to modify with your script and stops the script from finishing, dead in its tracks.
However, if you go in to revit, select all of those elements that you want to run the script on and set them to āMake elements editableā or āmake workset editableā beforehand, you wont get those error messages above, which can stop the script in its tracks. My question is are these features available in dynamo somewhere? is there a node for them? I would like the script to make elements editable before trying to write to them. Please advise thanks!
Is there a way to do this in python? I am not very advanced at writing my own python that calls on the Revit API unfortunately. Do you know of any place I can learn it?
Can you please tell me the intended input of this script? I cant seem to find anything it likes. I would like to just make one workset editable so I can move a list of elements there without having to worry about ownership issues. Please advise.
It looks like it expects either a single Element or list of Elements. Your bottom input looks to be a list of lists which is why that isnāt working either.
why Not just manually take ownership of the full workset before running the graph? This would inform you if there was an issue coming and expose who the coworkers which you will be interacting with are so you can communicate directly with the people youāll be overlapping elements with and likely give them the heads up sooner. Remember once you start those coworkers are tied out for 1hr+.
Hi Jacob! Its because I intend to automate this script. I intend to have it run after hours when no one is in the office. But I need to take ownership because some people dont close Revit/relinquish. Its inevitable that someone will own something I need eventually.
It isnāt possible to force relinquish using the Revit API, so this will have to be done manually. Elements can be filtered before attempting to check them out by using WorksharingUtils.GetCheckoutStatus. If this returns CheckoutStatus.OwnedByOtherUser you can assume you are not able to edit it, although, as noted in the API documentation:
Return values from inquiries about the worksharing status of elements or worksets rely on local caching of information from the central model so it is possible that the information is out of date. Because of this, the return value is suitable for reporting to an interactive user (e.g. via a mechanism similar to Worksharing display mode), but cannot be considered a reliable indication of whether the element can be immediately edited by the application. To make an immediate attempt to edit elements, use [!:CheckoutElements()] and check the return status, then confirm if the elements are up to date.
Hi @cgartland
do you know if this syntax is supposed to work in a code block? I cant seem to get it to workā¦Do you have any help pages for how to read the API page that you sent me to? I dont understand the layout of it or how I am supposed to use the commands on there.
Otherwise do you think this node from GeniusLoci does the same thing? Just filter out Owners that are not me?
Itās not totally the same API call.
On the link above : WorksharingUtils.GetCheckoutStatus :
The API explains : āGets the ownership status and outputs the owner of an element.ā
The custom node uses the WorksharingTooltipInfo.Owner.
The API explains : āThe current owner of the element or empty string if no one owns the element.ā
what happens in your above scripts if the element(s) that are pushed into them are not able to be āMade Editableā does it exclude those ones? It does not seem to give any sort of indication that it did not work for āsomeā of the input elementsā¦