public override void OnGripStatusChanged(ObjectId entityId, Status newStatus)
{
if (newStatus == Status.GripStart)
{
AcadHelpers.Editor.TurnForcedPickOn();
AcadHelpers.Editor.PointMonitor += AddNewVertex_EdOnPointMonitor;
}
if (newStatus == Status.GripEnd)
{
AcadHelpers.Editor.TurnForcedPickOff();
AcadHelpers.Editor.PointMonitor -= AddNewVertex_EdOnPointMonitor;
}
if (newStatus == Status.GripAbort)
{
AcadHelpers.Editor.TurnForcedPickOff();
AcadHelpers.Editor.PointMonitor -= AddNewVertex_EdOnPointMonitor;
}
base.OnGripStatusChanged(entityId, newStatus);
}
private void AddNewVertex_EdOnPointMonitor(object sender, PointMonitorEventArgs pointMonitorEventArgs)
{
try
{
Line leftLine = new Line(GripLeftPoint, pointMonitorEventArgs.Context.ComputedPoint)
{
ColorIndex = 150
};
pointMonitorEventArgs.Context.DrawContext.Geometry.Draw(leftLine);
if (GripRightPoint.HasValue)
{
Line rightLine = new Line(pointMonitorEventArgs.Context.ComputedPoint, GripRightPoint.Value)
{
ColorIndex = 150
};
pointMonitorEventArgs.Context.DrawContext.Geometry.Draw(rightLine);
}
}
catch
{
// ignored
}
}