TheSwamp
Code Red => .NET => Topic started by: Glenn R on December 03, 2006, 11:23:14 PM
-
I wanted one so here it is...some may find this useful also:
namespace ClassLibrary
{
public class tcgsClass
{
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acedSetStatusBarProgressMeter@@YAHPBDHH@Z")]
private static extern int acedSetStatusBarProgressMeter(string label, int minPos, int maxPos);
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acedSetStatusBarProgressMeterPos@@YAHH@Z")]
private static extern int acedSetStatusBarProgressMeterPos(int pos);
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acedRestoreStatusBar@@YAXXZ")]
private static extern int acedRestoreStatusBar();
public tcgsClass( ) { }
// Our one and only command
[CommandMethod("PBAR")]
static public void PBARCommand( )
{
acedSetStatusBarProgressMeter("Testing:", 0, 1000000);
for (int i = 0; i < 1000000; i++)
acedSetStatusBarProgressMeterPos(i);
acedRestoreStatusBar();
}
}
}
Cheers,
Glenn.
-
Hi Glenn;
What is your AutoCAD version? (just curios because of the P/invoke stuff usage)
I have A2007 and this is what I did, it might help, too.
using AcRx = Autodesk.AutoCAD.Runtime;
[CommandMethod("PBAR")]
static public void progressbar()
{
ProgressMeter pro = new ProgressMeter();
pro.Start("Testing...");
for (int i = 0; i < 1000000; i++)
pro.MeterProgress();
pro.Stop();
}
Have fun.
-
Heh...you're right Luis. I just checked the docs for 7 and it does indeed have a ProgressMeter.
This is for 2006, which unfortunately does not have a progress meter.
Thanks for letting me know about the one in 2007.
Cheers,
Glenn.
-
Heh...you're right Luis. I just checked the docs for 7 and it does indeed have a ProgressMeter.
This is for 2006, which unfortunately does not have a progress meter.
Thanks for letting me know about the one in 2007.
Cheers,
Glenn.
I see... glad I wait for A2007 - then... :)