For my friend who asked:
Is it possible to disable the pop-up, when you edit a floor: -Would you like walls that go up to his floor’s level to attach to its bottom?- I never want to do this, it’s annoying
Here is how to automatically dismiss that or any other Message Box or Task Dialog
private void Module_Startup(object sender, EventArgs e)
{
UIApplication uiapp = new UIApplication(this.Application);
// Subscribe to the DialogBoxShowing event to be notified when Revit is about to show a dialog box or a message box.
uiapp.DialogBoxShowing += new EventHandler(dismissFloorQuestion);
}
private void dismissFloorQuestion(object o, DialogBoxShowingEventArgs e)
{
// DialogBoxShowingEventArgs has two subclasses - TaskDialogShowingEventArgs & MessageBoxShowingEventArgs
// In this case we are interested in this event if it is TaskDialog being shown.
TaskDialogShowingEventArgs t = e as TaskDialogShowingEventArgs;
if (t != null && t.Message == "The floor/roof overlaps the highlighted wall(s). Would you like to join geometry and cut the overlapping volume out of the wall(s)?")
{
// Call OverrideResult to cause the dialog to be dismissed with the specified return value
// (int) is used to convert the enum TaskDialogResult.No to its integer value which is the data type required by OverrideResult
e.OverrideResult((int)TaskDialogResult.No);
}
}
Remember to add this line to the top of the file to avoid compilation errors:
using Autodesk.Revit.UI.Events;