Last active
January 19, 2025 16:09
-
-
Save ricaun/f79a086a0390fa1df2feb182c563bf6d to your computer and use it in GitHub Desktop.
Revit API in context implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool InContext(UIApplication application) | |
{ | |
try | |
{ | |
void Application_Idling(object sender, Autodesk.Revit.UI.Events.IdlingEventArgs e) { } | |
application.Idling += Application_Idling; | |
application.Idling -= Application_Idling; | |
return true; | |
} | |
catch { } // Invalid call to Revit API! Revit is currently not within an API context. | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment