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);
}
}
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.
Could you send an RVT/RFA sample (boostyourbim@gmail.com) ? If there is a Revit bug causing the groups to move, that will probably affect the API too.
Can you in .net create ceiling and floors made from rooms that cut into the door openings to the door mid-point?
The API can create floors, but not ceilings. What does it mean to cut into the door opening at the midpoint?
oh the floor outline is to the boundary of the room and then where there is a door the floor extends into the door opening about half the wall thickness or even better where the door leaf centre line is located.
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.
Could you send an RVT/RFA sample (boostyourbim@gmail.com) ? What is problem you have when doing this through the UI that you’d like to solve with the API?
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).
Hi,
If you are new to Revit macros, please take a look at my online video course at http://bit.ly/revitapi
Regards
Harry
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? 🙂
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);
}
}
}
}
Try changing this line to include DialogBoxShowingEventArgs
uiapp.DialogBoxShowing += new EventHandler(dismissTaskDialog);
That worked! I changed it to
uiapp.DialogBoxShowing += new EventHandler(dismissTaskDialog);
and it compiled and ran fine! VERY helpful, thanks!
I still can’t get this to work.
Can someone post to correct code?
Could you explain more about what is not working? Does dismissTaskDialog ever get called (maybe put a TaskDialog.Show() in there to see what happens)?