سؤال

if (WorksharingUtils.GetCheckoutStatus(doc, ((Element)view).Id) != 1)

Error Operator '!=' cannot be applied to operands of type 'Autodesk.Revit.DB.CheckoutStatus' and 'int'

هل كانت مفيدة؟

المحلول

You need to be comparing the result of GetCheckoutStatus to one of the CheckoutStatus enumerations: OwnedByCurrentUser - The element is owned by the current user.
OwnedByOtherUser - The element is owned by some user other than the current user.
NotOwned - The element is not owned by any user.

For example:

if (WorksharingUtils.GetCheckoutStatus(doc, view.Id) != CheckoutStatus.NotOwned)

Additionally, note that I removed the cast to Element - it is not required here.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top