We can use the Editor.DrawVector to create some animation effect easily such as radar scanning. Here we go.
[CommandMethod("Radar")]
public static void Radar_Method()
{
Editor ed = MgdAcApplication.DocumentManager.MdiActiveDocument.Editor;
try
{
for (int i = 0; i < 360; i++)
{
double angle = Math.PI / 180 * i;
Point3d end = new Point3d(Math.Cos(angle), Math.Sin(angle), 0);
ed.DrawVector(Point3d.Origin, end, 1, false);
ed.UpdateScreen();
System.Threading.Thread.Sleep(1);
}
}
catch (System.Exception ex)
{
ed.WriteMessage(Environment.NewLine + ex.ToString());
}
}
Here is how it behaves in AutoCAD.
Enjoy!
The leading edge AutoCAD .NET Addin Wizard (AcadNetAddinWizard) provides various project wizards, item wizards, coders and widgets to help program AutoCAD .NET addins.
Posted by: |