ICentralLockedCallback

hey all ,
has anybody successfully implemented this interface in their code ? i saw this class recently but haven’t been able to get consistent results . Wondering if anybody else has any opinions or thoughts


// This class implements the ICentralLockedCallback to override Revit's default
// behavior for how to handle when the central model is locked by another user
class SynchLockCallback : ICentralLockedCallback
{
    // If unable to lock central, give up rather than waiting
    public bool ShouldWaitForLockAvailability()
    {
        return false;
    }

}

@revitislife ,

is this only for hooks ?

in which context do want it to use?

I am trying to implement my sync - so ideally, I don’t want people to be stuck in syncing if the central model is busy

Maybe looking at @dosymep example, that will help

Whenever I cannot find a snippet, I try the brute force approach of searching in the whole GitHub code base catalog Code search results · GitHub

2 Likes

Thanks that is what I was going off of - but it seems like it is inconsistent when dealing with cloud models. It works sometimes- but the rest of the time it sends Revit into a frozen state and Revit ends up crashing

1 Like