Skip to content
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

Merged
merged 38 commits into from
Sep 5, 2022

Conversation

travispotterBH
Copy link

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 the Revit_Core_Engine for Element class
  • Query.ElementsOwnedByCurrentUser() Query method added in the Revit_Core_Engine for Element class
  • Query.ElementsOwnedByNone() Query method added in the Revit_Core_Engine for Element class
  • Query.ElementsEditablePerCheckoutStatus() Query method added in the Revit_Core_Engine for Element class
  • Query.IsOwnedByOtherUser() Query method added in the Revit_Core_Engine for Element class
  • Query.IsOwnedByCurrentUser() Query method added in the Revit_Core_Engine for Element class
  • Query.IsOwnedByNone() Query method added in the Revit_Core_Engine for Element class
  • Query.CheckoutStatus() Query method added in the Revit_Core_Engine for Element class
  • Modify.Checkout() Modify method added in the Revit_Core_Engine for Element class
  • ElementOwnedByOtherUserWarning() Warning added to Revit_Core_Engine for Element class
  • ElementOwnedByCurrentUserNote() Note added to Revit_Core_Engine for Element class

Additional 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
image
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.

@travispotterBH travispotterBH self-assigned this Sep 2, 2022
@travispotterBH travispotterBH added the type:feature New capability or enhancement label Sep 2, 2022
Copy link
Member

@pawelbaran pawelbaran left a 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 🙈

Revit_Core_Engine/Modify/Checkout.cs Outdated Show resolved Hide resolved
Revit_Core_Engine/Query/CheckoutStatus.cs Outdated Show resolved Hide resolved
Revit_Core_Engine/Modify/Checkout.cs Outdated Show resolved Hide resolved
travispotterBH and others added 2 commits September 2, 2022 10:32
Copy link
Member

@pawelbaran pawelbaran left a 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)...

Revit_Core_Engine/Query/IsOwnedByCurrentUser.cs Outdated Show resolved Hide resolved
Revit_Core_Engine/Query/IsOwnedByNone.cs Outdated Show resolved Hide resolved
Revit_Core_Engine/Query/IsOwnedByOtherUser.cs Outdated Show resolved Hide resolved
Revit_Core_Engine/Query/ElementsOwnedByOtherUsers.cs Outdated Show resolved Hide resolved
Travis Potter and others added 7 commits September 2, 2022 11:20
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>
@travispotterBH
Copy link
Author

updated. Included updated error messages on null handling.

Copy link
Member

@pawelbaran pawelbaran left a 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
Copy link
Author

@BHoMBot check required
@BHoMBot check dataset-compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Sep 2, 2022

@travispotterBH to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer
  • check dataset-compliance

There are 85 requests in the queue ahead of you.

Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a 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!

@travispotterBH travispotterBH changed the title Revit_Engine_Core-#1227-Query methods for element ownership status Revit_Toolkit-#1227-Element Checkout Status Query Sep 2, 2022
@pawelbaran
Copy link
Member

@BHoMBot check copyright-compliance
@BHoMBot check ready-to-merge

@pawelbaran pawelbaran changed the title Revit_Toolkit-#1227-Element Checkout Status Query Revit_Core_Engine: Element Checkout Status Query Added Sep 5, 2022
@pawelbaran pawelbaran dismissed FraserGreenroyd’s stale review September 5, 2022 08:19

PR title tweaked as requested

@pawelbaran
Copy link
Member

@BHoMBot check copyright-compliance
@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Sep 5, 2022

@pawelbaran to confirm, the following actions are now queued:

  • check copyright-compliance
  • check ready-to-merge

There are 1 requests in the queue ahead of you.

@pawelbaran pawelbaran merged commit 75b2e21 into main Sep 5, 2022
@pawelbaran pawelbaran deleted the Revit_Toolkit-#1227-CheckOwnership branch September 5, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Element Checkout Status Query
3 participants