Dear MexicanCustard,
I have tried the following code but with no success. Can you point me if I am missing anything as I am quite new in the .net world. I am using Windows7 x86.
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.EditorInput;
using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Windows.Forms;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
namespace ClassLibrary1
{
public class Class1
{
[DllImport("user32.dll")]
static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, bool bErase);
[DllImport("user32.dll")]
static extern bool UpdateWindow(IntPtr hWnd);
[LispFunction("sRedraw")]
public object CDRedraw(ResultBuffer LispArgs)
{
Editor AcadEditor = AcadApp.DocumentManager.MdiActiveDocument.Editor;
IntPtr hWnd = AcadApp.MainWindow.Handle;
InvalidateRect(hWnd, IntPtr.Zero, true);
UpdateWindow(hWnd); // Tested upto here but not working.
// added following code to test again. It does remove the dialog box
// but the process in the commandline is not showing
// e.g (princ (strcat "\rCreating Points" (itoa (1+ counter)) " of 2500"))
AcadEditor.Regen();
AcadEditor.UpdateScreen();
System.Windows.Forms.Application.DoEvents();
return null;
}
}
}
Thanks