here is my code
//ParamDictionary dict is just a list of points I give to a rectangle class
public class CabJig : DrawJig, IDisposable
{
// Fields
private Point3d currentCursorPosition;
private bool disposed;
private Editor editor;
private Rectangle entityToDrag;
private Point3d previousCursorPosition;
// Constructors
private CabJig()
{
}
public CabJig(ref ParamDictionary dict)
{
this.previousCursorPosition = new Point3d(0.0, 0.0, 0.0);
this.entityToDrag = new Rectangle(ref dict);
this.entityToDrag.Color = Color.FromColorIndex(ColorMethod.ByAci, 10);
this.editor = Application.DocumentManager.MdiActiveDocument.Editor;
}
// Methods
private bool CursorHasMoved()
{
return !(this.currentCursorPosition == this.previousCursorPosition);
}
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (!this.disposed)
{
if (disposing)
{
this.entityToDrag.Dispose();
}
this.disposed = true;
}
}
protected override SamplerStatus Sampler(JigPrompts prompts)
{
PromptPointResult userFeedback = prompts.AcquirePoint("\nSpecify insertion point:");
this.currentCursorPosition = userFeedback.Value;
if (this.CursorHasMoved())
{
this.entityToDrag.DrawFrom(this.currentCursorPosition);
this.previousCursorPosition = this.currentCursorPosition;
return SamplerStatus.OK;
}
return SamplerStatus.NoChange;
}
public Point3d StartJig()
{
if (this.editor.Drag(this).Status != PromptStatus.OK)
{
throw new System.Exception();
}
return this.currentCursorPosition;
}
protected override bool WorldDraw(WorldDraw draw)
{
draw.Geometry.Draw(this.entityToDrag);
return true;
}
}