#BILTNA2018 Wish granted: Remove warning when modifying type parameter values in schedule

This sample shows how to “Remove warning/pop-up when modifying type parameter values within a schedule” using the DialogBoxShowing event.

Please remove the warning/pop-up that appears when editing scheduled fields that are tied to type parameters.  This is EXTREMELY annoying when entering data for our MEP schedules.  I.E. Plumbing Fixtures, Air Devices, Lighting Fixtures, etc.

The popup reads:

“This change will be applied to all elements of type _______.”

In instances where we are filling out a schedule, we are forced to enter our data, press enter or click out of the cell, and then respond to this popup. EVERY TIME

public void registerWarningSuppresion()
{
    Document doc = this.ActiveUIDocument.Document;   
    Application app = doc.Application;
    UIApplication uiapp = new UIApplication(app);
    uiapp.DialogBoxShowing += new EventHandler(dismissTaskDialog);
}

private void dismissTaskDialog(object sender, DialogBoxShowingEventArgs args)
{
    TaskDialogShowingEventArgs e = args as TaskDialogShowingEventArgs;
    if (e == null)
        return;
    if (e.Message.StartsWith("This change will be applied to all elements of type"))
    {
        e.OverrideResult((int)TaskDialogCommonButtons.Ok);
    }
}
Advertisements

13 thoughts on “#BILTNA2018 Wish granted: Remove warning when modifying type parameter values in schedule

  1. Hi Harry,
    Could you show us how to open a family change subcategories within a nested array that contains generic forms? I have seen posts on modifying parameters in groups however I was wondering if this is possible within a family document. Attempts within the project environment have been met with frustration as the groups tend to move.

  2. Another one i just thought of, can you create and modify subcategories within a family document when the generic forms are inside of a group? further can you swap the linestyle subcategories inside of a group?
    Typically these would be arrayed groups so the other problem is that they might be nested. although most families we deal with have on one nesting level.

  3. Thank you for making this post. I came here through the Ideas forum. I’m trying to get this running but my macro won’t run (this is my first time making a Revit macro). Would you mind sharing the steps how you created the macro (the video seems to skip that part).

      • Hey Harry,

        On the long term I definitely want to look into the macro’s but today I was just hoping to get this going as I need to edit a schedule with thousands of element with tons of type properties 🙂

        I think I’m a little bit further now but I’m still getting a compile error on this line with “uiapp.DialogBoxShowing += new EventHandler(dismissTaskDialog);”

        The error is: No overlead for ‘dismissTaskDialog’ matches delegate ‘System.Eventhandler’ (CS0123)

        Any ideas? 🙂

  4. This is the code of my macro, anyone any idea what I’m doing wrong?

    using System;
    using Autodesk.Revit.UI;
    using Autodesk.Revit.DB;
    using Autodesk.Revit.UI.Selection;
    using System.Collections.Generic;
    using System.Linq;
    using Autodesk.Revit.DB.Visual;
    using Autodesk.Revit.ApplicationServices;

    using Autodesk.Revit.UI.Events;

    namespace test
    {
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
    [Autodesk.Revit.DB.Macros.AddInId(“739D5A0F-22AE-43D4-8F69-93CE63CAEC56”)]
    public partial class ThisApplication
    {

    public void registerWarningSuppresion()
    {
    Document doc = this.ActiveUIDocument.Document;
    Application app = doc.Application;
    UIApplication uiapp = new UIApplication(app);
    uiapp.DialogBoxShowing += new EventHandler(dismissTaskDialog);
    }

    private void dismissTaskDialog(object sender, DialogBoxShowingEventArgs args)
    {
    TaskDialogShowingEventArgs e = args as TaskDialogShowingEventArgs;
    if (e == null)
    return;
    if (e.Message.StartsWith(“This change will be applied to all elements of type”))
    {
    e.OverrideResult((int)TaskDialogCommonButtons.Ok);
    }
    }

    }
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s