-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revit_Core_Engine: Element Checkout Status Query Added #1248
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each time I look at this PR, I find potential tweaks 🙈
Co-authored-by: Pawel Baran <pawel.baran@burohappold.com>
…om/BHoM/Revit_Toolkit into Revit_Toolkit-#1227-CheckOwnership
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will start hating me soon @travispotterBH (if you have not yet)...
Co-authored-by: Pawel Baran <pawel.baran@burohappold.com>
Co-authored-by: Pawel Baran <pawel.baran@burohappold.com>
Co-authored-by: Pawel Baran <pawel.baran@burohappold.com>
Co-authored-by: Pawel Baran <pawel.baran@burohappold.com>
updated. Included updated error messages on null handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is great now, thank you for patience @travispotterBH. Happy to approve! 🎉
@travispotterBH to confirm, the following actions are now queued:
There are 85 requests in the queue ahead of you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we improve the PR title for change log please before merging? Happy for this review to be dismissed once PR title is improved @travispotterBH @pawelbaran - thanks!
PR title tweaked as requested
@pawelbaran to confirm, the following actions are now queued:
There are 1 requests in the queue ahead of you. |
Issues addressed by this PR
Closes #1227
Methods have been added to support the checking of single and lists of elements for their ownership/checkout status.
Test files
Changelog
Query.ElementsOwnedByOtherUsers()
Query method added in theRevit_Core_Engine
forElement
classQuery.ElementsOwnedByCurrentUser()
Query method added in theRevit_Core_Engine
forElement
classQuery.ElementsOwnedByNone()
Query method added in theRevit_Core_Engine
forElement
classQuery.ElementsEditablePerCheckoutStatus()
Query method added in theRevit_Core_Engine
forElement
classQuery.IsOwnedByOtherUser()
Query method added in theRevit_Core_Engine
forElement
classQuery.IsOwnedByCurrentUser()
Query method added in theRevit_Core_Engine
forElement
classQuery.IsOwnedByNone()
Query method added in theRevit_Core_Engine
forElement
classQuery.CheckoutStatus()
Query method added in theRevit_Core_Engine
forElement
classModify.Checkout()
Modify method added in theRevit_Core_Engine
forElement
classElementOwnedByOtherUserWarning()
Warning added toRevit_Core_Engine
forElement
classElementOwnedByCurrentUserNote()
Note added toRevit_Core_Engine
forElement
classAdditional comments
Note: The methods work over a cached local version to determine ownership. They will only be as up to date at the most recently sync + reload by the user.
https://www.revitapidocs.com/2023/1a4b4bbb-060d-1f42-fbb2-ab85081f8e7f.htm
I attempted to prompted the user to reload latest via task dialog window which alerted the user to the need to reload and asked for confirmation to proceed with a reload latest. However, the reload latest fails when called from one of the methods due to an open transaction. We could possibly set some rules on the toolkits Run command for methods that modify elements to do a reload latest before initiating the transaction as a resolution to this error.