Exemplo n.º 1
0
        public override void OnDraw(GeometryBuilder dc)
        {
            dc.Clear();
            dc.Color = McDbEntity.ByObject;
            _blockRef[0].DbEntity.Erase();
            _blockRef[1].DbEntity.Erase();

            _blockRef[0].InsertPoint = _pnt1;
            _blockRef[0].DbEntity.AddToCurrentDocument();


            double inbetween = Math.Round(_pnt1.DistanceTo(_pnt2) / (Count + 1), 4);

            for (int i = 1; i <= Count; i++)
            {
                double distance = inbetween * i;

                _blockRef[i + 1].DbEntity.Erase();

                _blockRef[i + 1].InsertPoint = new Point3d(_pnt1.X + distance, _pnt1.Y, 0).Rotate(_pnt1, _pnt1.AngleTo(_pnt2));
                _blockRef[i + 1].DbEntity.AddToCurrentDocument();
            }

            _blockRef[1].InsertPoint = _pnt2;
            _blockRef[1].DbEntity.AddToCurrentDocument();

            dc.Color = System.Drawing.Color.Cyan;
            dc.DrawLeader(_pnt2, _pnt1, Arrows.Arrow, 5);
        }