/// <inheritdoc />
        public override ReturnValue OnHotGrip(ObjectId entityId, Context contextFlags)
        {
            using (Section)
            {
                Point3d?newInsertionPoint = null;

                if (GripIndex == 0)
                {
                    Section.InsertionPoint = Section.MiddlePoints[0];
                    newInsertionPoint      = Section.MiddlePoints[0];
                    Section.MiddlePoints.RemoveAt(0);
                }
                else if (GripIndex == Section.MiddlePoints.Count + 1)
                {
                    Section.EndPoint = Section.MiddlePoints.Last();
                    Section.MiddlePoints.RemoveAt(Section.MiddlePoints.Count - 1);
                }
                else
                {
                    Section.MiddlePoints.RemoveAt(GripIndex - 1);
                }

                Section.UpdateEntities();
                Section.BlockRecord.UpdateAnonymousBlocks();
                using (var tr = AcadUtils.Database.TransactionManager.StartOpenCloseTransaction())
                {
                    var blkRef = tr.GetObject(Section.BlockId, OpenMode.ForWrite, true, true);
                    if (newInsertionPoint.HasValue)
                    {
                        ((BlockReference)blkRef).Position = newInsertionPoint.Value;
                    }

                    using (var resBuf = Section.GetDataForXData())
                    {
                        blkRef.XData = resBuf;
                    }

                    tr.Commit();
                }
            }

            return(ReturnValue.GetNewGripPoints);
        }
        /// <inheritdoc />
        public override void OnGripStatusChanged(ObjectId entityId, Status newStatus)
        {
            if (newStatus == Status.GripStart)
            {
                AcadUtils.Editor.TurnForcedPickOn();
                AcadUtils.Editor.PointMonitor += AddNewVertex_EdOnPointMonitor;
            }

            if (newStatus == Status.GripEnd)
            {
                AcadUtils.Editor.TurnForcedPickOff();
                AcadUtils.Editor.PointMonitor -= AddNewVertex_EdOnPointMonitor;
                using (Section)
                {
                    Point3d?newInsertionPoint = null;

                    if (GripLeftPoint == Section.InsertionPoint)
                    {
                        Section.MiddlePoints.Insert(0, NewPoint);
                    }
                    else if (GripLeftPoint == null)
                    {
                        Section.MiddlePoints.Insert(0, Section.InsertionPoint);
                        Section.InsertionPoint = NewPoint;
                        newInsertionPoint      = NewPoint;
                    }
                    else if (GripRightPoint == null)
                    {
                        Section.MiddlePoints.Add(Section.EndPoint);
                        Section.EndPoint = NewPoint;
                    }
                    else
                    {
                        Section.MiddlePoints.Insert(Section.MiddlePoints.IndexOf(GripLeftPoint.Value) + 1, NewPoint);
                    }

                    Section.UpdateEntities();
                    Section.BlockRecord.UpdateAnonymousBlocks();
                    using (var tr = AcadUtils.Database.TransactionManager.StartOpenCloseTransaction())
                    {
                        var blkRef = tr.GetObject(Section.BlockId, OpenMode.ForWrite, true, true);
                        if (newInsertionPoint.HasValue)
                        {
                            ((BlockReference)blkRef).Position = newInsertionPoint.Value;
                        }

                        using (var resBuf = Section.GetDataForXData())
                        {
                            blkRef.XData = resBuf;
                        }

                        tr.Commit();
                    }
                }
            }

            if (newStatus == Status.GripAbort)
            {
                AcadUtils.Editor.TurnForcedPickOff();
                AcadUtils.Editor.PointMonitor -= AddNewVertex_EdOnPointMonitor;
            }

            base.OnGripStatusChanged(entityId, newStatus);
        }