How to click OK Button automatically of wall overlap warning?

How to click OK Button automatically of wall overlap warning?

prasannamurumkar
Advocate Advocate
710 Views
1 Reply
Message 1 of 2

How to click OK Button automatically of wall overlap warning?

prasannamurumkar
Advocate
Advocate

Hi,

 

Could anyone help in this case for below warning.Want to press ok button not dismiss dialog.

1.png

 Tried by various ways discussed by jeremy.

1.Tried by  firing application.DialogBoxShowing
+= new EventHandler<DialogBoxShowingEventArgs>(
a_DialogBoxShowing); event.

 

 

void a_DialogBoxShowing(
object sender,
DialogBoxShowingEventArgs e)
{
e.OverrideResult((int)DialogResult.OK);

}

 

 

In this case event gets fire but dialog just closed not press ok.So the wall created is not sustain(ex = {"The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone."}) so problem continues.

Can anyone suggest what to do get require result.

 

2.JtClicker application(Created by jeremy):

Could anyone suggest is this application how will work in above case(How to reference?).

Have downloaded jip file.->And extracted.->And used same .net famework to build.->And created class library solution to reference dll.

Should we create separate application for this.Or should we reference dll  in our revit application.

 

3.Also tried one of the solution of blogger actually not understood this method completely but tried this way.

before the transaction commit of wall following lines are added.

Process process = Process.GetCurrentProcess();

IntPtr hwnd = process.MainWindowHandle;

var data = new Entry.WindowInterceptor(
hwnd, Entry.CmdMain.ProcessWindow);
data.Stop();
tr.Commit();

And in processwindow following code added.

 

public static void ProcessWindow(
IntPtr hwnd)
{
IntPtr h =
(IntPtr)Functions.FindWindowEx(hwnd, IntPtr.Zero, "Button", "OK");
if (h != IntPtr.Zero)
{
//clicking the found button
Functions.SendMessage
((IntPtr)h, (uint)Messages.WM_LBUTTONDOWN, 0, 0);
Functions.SendMessage
((IntPtr)h, (uint)Messages.WM_LBUTTONUP, 0, 0);
}


}

 

 

Please suggest the better solution for above problem.

 

0 Likes
711 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni