private int _ysize; // кол рядов участков в зоне покраски
                            // Распределяемые цвета

        public RandomPaintService()
        {
            _doc           = Application.DocumentManager.MdiActiveDocument;
            _ed            = _doc.Editor;
            _db            = _doc.Database;
            _rnd           = new Random();
            _colorAreaSize = new ColorAreaSpotSize(Settings.Default.TileLenght + Settings.Default.TileSeam,
                                                   Settings.Default.TileHeight + Settings.Default.TileSeam, "RandomPaint");
        }
        private int _ysize; // кол рядов участков в зоне покраски

        #endregion Fields

        #region Constructors

        // Распределяемые цвета
        public RandomPaintService()
        {
            _doc = Application.DocumentManager.MdiActiveDocument;
            _ed = _doc.Editor;
            _db = _doc.Database;
            _rnd = new Random();
            _colorAreaSize = new ColorAreaSpotSize(Settings.Default.TileLenght + Settings.Default.TileSeam,
                                       Settings.Default.TileHeight + Settings.Default.TileSeam, "RandomPaint");
        }
 public static void SetDynParamColorAreaBlock(BlockReference blRefcolorAreaSpot, ColorAreaSpotSize colorAreaSize)
 {
     foreach (DynamicBlockReferenceProperty item in blRefcolorAreaSpot.DynamicBlockReferencePropertyCollection)
     {
         if (string.Equals(item.PropertyName, Settings.Default.BlockColorAreaDynPropLength, StringComparison.InvariantCultureIgnoreCase))
         {
             item.Value = (double)colorAreaSize.LenghtSpot;
         }
         else if (string.Equals(item.PropertyName, Settings.Default.BlockColorAreaDynPropHeight, StringComparison.InvariantCultureIgnoreCase))
         {
             item.Value = (double)colorAreaSize.HeightSpot;
         }
     }
 }
 public static void SetDynParamColorAreaBlock(BlockReference blRefcolorAreaSpot, ColorAreaSpotSize colorAreaSize)
 {
     foreach (DynamicBlockReferenceProperty item in blRefcolorAreaSpot.DynamicBlockReferencePropertyCollection)
     {
         if (string.Equals(item.PropertyName, Settings.Default.BlockColorAreaDynPropLength, StringComparison.InvariantCultureIgnoreCase))
             item.Value = (double)colorAreaSize.LenghtSpot;
         else if (string.Equals(item.PropertyName, Settings.Default.BlockColorAreaDynPropHeight, StringComparison.InvariantCultureIgnoreCase))
             item.Value = (double)colorAreaSize.HeightSpot;
     }
 }