Ejemplo n.º 1
0
 /// <summary>
 /// стержни распределенные по ширина с шагом и рядами
 /// </summary>
 public Bar(int diam, int len, int width, int step, int rows, string pos, ISpecBlock block, string friendlyName)
     : this(diam, len, 1, pos, block, friendlyName)
 {
     Rows  = rows;
     Width = width;
     Step  = step;
 }
Ejemplo n.º 2
0
 public Construction(string prefix, string mark, ISpecBlock block, double weightUnit)
 {
     this.prefix = prefix;
     Mark        = mark;
     Count       = 1;
     Key         = Name;
 }
Ejemplo n.º 3
0
 public Column(int length, int width, int height, string mark, ISpecBlock block, List <ISpecElement> elements) :
     base(mark, "К-", block, elements)
 {
     Size = new ConstructionSize(length, width, height);
     Name = $"{FriendlyName}, {length}х{width}, h={height}мм";
     Key  = Name + string.Join(";", elements.Select(e => e.Key + e.Amount)) + Amount;
 }
Ejemplo n.º 4
0
 public ConstructionElement(string mark, string prefix, ISpecBlock block, List <ISpecElement> elements)
 {
     Mark        = mark;
     SpecBlock   = block;
     this.prefix = prefix;
     Elements    = elements.OrderBy(e => e.Group).ThenBy(e => e.Index).ThenBy(e => e).ToList();
     Amount      = elements.Sum(e => e.Amount);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Стержень по количеству штук
 /// </summary>
 public Bar(int diam, int len, int count, string pos, ISpecBlock block, string friendlyName) : base(diam, len)
 {
     FriendlyName = friendlyName;
     SpecBlock    = block;
     Mark         = pos;
     Count        = count;
     Key          = GetName();
 }
Ejemplo n.º 6
0
 public Wall(string mark, int length, int width, int height, ISpecBlock block) :
     base("См-", mark, block, 0)
 {
     this.length = length;
     this.width  = width;
     this.height = height;
     Name        = $"Стена монолитная, {width}х{length}, h={height}мм";
 }
Ejemplo n.º 7
0
 public Beam(string mark, int length, int width, int height, ISpecBlock block) :
     base("Б-", mark, block, 0)
 {
     this.length = length;
     this.width  = width;
     this.height = height;
     Name        = $"Балка монолитная, {width}х{height}, L={length}мм";
 }
Ejemplo n.º 8
0
 public Column(string mark, int length, int width, int height, ISpecBlock block) :
     base("К-", mark, block, 0)
 {
     this.length = length;
     this.width  = width;
     this.height = height;
     Name        = $"Колонна монолитная, {length}х{width}, h={height}мм";
 }
Ejemplo n.º 9
0
 public Pylon(string mark, int length, int width, int height, ISpecBlock block) :
     base("П-", mark, block, 0)
 {
     this.length = length;
     this.width  = width;
     this.height = height;
     Name        = $"Пилон монолитный, {length}х{width}, h={height}мм";
 }
Ejemplo n.º 10
0
 public ConcreteH(string concrete, double volume, ISpecBlock block)
     : base(concrete)
 {
     Key          = Name;
     FriendlyName = Name;
     SpecBlock    = block;
     Volume       = volume;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Создание гнутого стержня - по шагу
 /// </summary>
 /// <param name="diam">Диаметр</param>
 /// <param name="lGs">Длина Гс</param>
 /// <param name="hGs">Высота Гс</param>
 /// <param name="count">Кол</param>
 /// <param name="pos">Значение атрибута позиции из блока</param>
 /// <param name="block">Блок</param>
 public BentBarLshaped(int diam, int lGs, int hGs, int count, string pos, ISpecBlock block)
     : base(diam, getLength(lGs, hGs, diam), count, PREFIX, pos, block, friendlyName)
 {
     H = hGs;
     L = lGs;
     //descEnd = ", шт." + count;
     Key += "h" + H + "l" + L;
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Отбор и определение блоков спецификации
        /// </summary>
        private List <ISpecBlock> FilterBlocks(List <ObjectId> ids)
        {
            var blocks = new List <ISpecBlock>();

            if (ids == null || ids.Count == 0)
            {
                return(blocks);
            }
            using (var t = db.TransactionManager.StartTransaction())
            {
                foreach (var idEnt in ids)
                {
                    var blRef = idEnt.GetObject(OpenMode.ForRead, false, true) as BlockReference;
                    if (blRef == null)
                    {
                        continue;
                    }
                    string blName = blRef.GetEffectiveName();
                    try
                    {
                        ISpecBlock block = SpecBlockFactory.CreateBlock(blRef, blName, options);
                        if (block == null)
                        {
                            ed.WriteMessage($"\nПропущен блок '{blName}'");
                            continue;
                        }
                        block.Calculate();
                        if (block.Error == null)
                        {
                            blocks.Add(block);
                        }
                        else
                        {
                            Inspector.Errors.Add(block.Error);
                        }
                    }
                    catch (Exception ex)
                    {
                        Inspector.AddError($"Ошибка при обработке блока {blName} - {ex}",
                                           blRef, System.Drawing.SystemIcons.Error);
                    }
                }
                t.Commit();
            }
            if (blocks.Count == 0)
            {
                throw new Exception($"\nБлоки для спецификации не определены.");
            }

            // Проверка дубликатов
            if (options.CheckDublicates)
            {
                AcadLib.Blocks.Dublicate.CheckDublicateBlocks.Check(blocks.Select(s => s.Block.IdBlRef));
            }

            return(blocks);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Шпилька - с шагом по ширине распределения и кол рядов
 /// </summary>
 /// <param name="diam">Диам</param>
 /// <param name="lRab">Раст между раб стержнями (от центров раб стержней)</param>
 /// <param name="step">Шаг</param>
 /// <param name="width">Ширина распределения</param>
 /// <param name="rows">Рядов шпилек</param>
 /// <param name="pos">значение атр позиции</param>
 /// <param name="block">Блок</param>
 public Spring(int diam, int lRab, int step, int width, int rows, string pos, ISpecBlock block)
     : base(diam, GetLength(lRab, diam), width, step, rows, PREFIX, pos, block, friendlyName)
 {
     //descEnd = $", ш.{step}";
     tail  = getTail(diam);
     LRab  = RoundHelper.Round5(lRab);
     Class = ClassA240C;
     Gost  = GostOld;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Погонные стержни с шагом и диапазоном распределения
 /// </summary>
 public BarRunning(int diam, double length, int widthRun, int step, int rows, string pos,
                   ISpecBlock block, string friendlyName)
     : base(diam, 0, 1, pos, block, friendlyName)
 {
     Rows   = rows;
     Width  = widthRun;
     Step   = step;
     Meters = CalcMeters(length);
     Key    = GetKey();
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Труба стальная электросварная прямошовная.
 /// </summary>
 /// <param name="diam">Диаметр</param>
 /// <param name="t">Толщина стенки</param>
 public Tube(double diam, double t, int length, ISpecBlock block) :
     base(GostElectricWelded, Symbols.Diam + diam + "х" + t)
 {
     SpecBlock    = block;
     Diametr      = diam;
     Thickness    = t;
     Length       = length;
     WeightUnit   = CalcWeightTube(diam, t); //weightUnit;
     FriendlyName = "Труба " + Name;
     Key          = Name;
 }
Ejemplo n.º 16
0
 public SlabSleeve(string mark, double diam, double depth, int length, string role, string desc, ISpecBlock specBlock)
 {
     SpecBlock   = specBlock;
     this.diam   = diam;
     this.depth  = depth;
     this.length = length;
     Mark        = mark;
     Role        = role;
     Description = desc;
     Count       = 1;
     Dimension   = $"Гильза {AcadLib.General.Symbols.Diam}{diam}х{depth}, L={length}";
     Key         = Dimension + Role;
 }
Ejemplo n.º 17
0
 public Opening(string mark, int lenght, int height, string elevation, string role, string desc,
                ISpecBlock specBlock)
 {
     SpecBlock   = specBlock;
     Mark        = mark;
     Role        = role;
     Count       = 1;
     Description = desc;
     Elevation   = elevation;
     this.length = lenght;
     this.height = height;
     Dimension   = length + "х" + height + "(h)";
     Key         = Dimension + Elevation + Role;
 }
Ejemplo n.º 18
0
 public SlabOpening(string mark, int side1, int side2, string role, string desc, ISpecBlock specBlock)
 {
     SpecBlock   = specBlock;
     Mark        = mark;
     Role        = role;
     Count       = 1;
     Description = desc;
     if (side1 >= side2)
     {
         length = side1;
         width  = side2;
     }
     else
     {
         length = side2;
         width  = side1;
     }
     Dimension = length + "х" + width;
     Key       = Dimension + Role;
 }
Ejemplo n.º 19
0
 public ConcreteH(string concrete, double len, double width, double height, ISpecBlock block)
     : this(concrete, CalcVolume(len, width, height), block)
 {
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Деталь по распределению
 /// </summary>
 public BarDetail(int diam, int len, int width, int step, int rows, string prefix, string pos,
                  ISpecBlock block, string friendlyName)
     : base(diam, len, width, step, rows, pos, block, friendlyName)
 {
     this.prefix = prefix;
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Деталь по штукам
 /// </summary>
 public BarDetail(int diam, int len, int count, string prefix, string pos,
                  ISpecBlock block, string friendlyName)
     : base(diam, len, count, pos, block, friendlyName)
 {
     this.prefix = prefix;
 }
Ejemplo n.º 22
0
 public Aperture(int index, string prefix, string mark, int lenght, int height, string elevation, string role, string desc, ISpecBlock specBlock)
     : base(mark, lenght, height, elevation, role, desc, specBlock)
 {
     this.prefix = prefix;
     Index       = index;
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Создание скобы по распределению
 /// </summary>
 /// <param name="d">Диаметр скобы</param>
 /// <param name="h">Длина нахлеста скобы - вылет (от внутренней грани стержня)</param>
 /// <param name="t">Ширина скобы (по внутренней грани стержня) - округляется до 5</param>
 /// <param name="step">Шаг скобы</param>
 /// <param name="width">Ширина распределения</param>
 /// <param name="pos">Позиция (из атрибута блока)</param>
 /// <param name="block">Блок</param>
 public Bracket(int d, int h, int t, int step, int width, int rows, string pos, ISpecBlock block, string friendlyName)
     : base(d, CalcLength(h, t, d), width, step, rows, PREFIX, pos, block, friendlyName)
 {
     T    = RoundHelper.Round5(t);
     L    = h;
     Key += "t" + T + "l" + L;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Создание гнутого стержня по штукам
 /// </summary>
 /// <param name="diam">Диаметр</param>
 /// <param name="lStart">Длина 1 Гс</param>
 /// <param name="lEnd">Длина 2 Гс</param>
 /// <param name="lDif">Длина перепада</param>
 /// <param name="hDif">Высота перепада</param>
 /// <param name="count">Кол</param>
 /// <param name="pos">Значение атрибута позиции из блока</param>
 /// <param name="block">Блок</param>
 public BentBarDirect(int diam, int lStart, int lEnd, int lDif, int hDif, int count, string pos, ISpecBlock block)
     : base(diam, getLength(lStart, lEnd, lDif, hDif, diam), count, PREFIX, pos, block, friendlyName)
 {
     LStart = lStart;
     LEnd   = lEnd;
     HDif   = hDif;
     LDif   = lDif;
     Key   += "s" + LStart + "e" + LEnd + "hd" + HDif + "ld" + LDif;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Погонные стержни по длине (м.)
 /// </summary>
 public BarRunning(int diam, double meters, string pos, ISpecBlock block, string friendlyName)
     : base(diam, 0, 1, pos, block, friendlyName)
 {
     Meters = RoundHelper.Round2Digits(meters);
     Key    = GetKey();
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Шпилька распределенная по площади стены
 /// </summary>
 /// <param name="diam">Диаметр шпильки</param>
 /// <param name="diamWork">Диам раб арм</param>
 /// <param name="lRab">Раст между раб стержнями (от центров раб стержней)</param>
 /// <param name="stepHor">Шаг шпилек по горизонтали</param>
 /// <param name="stepVert">Шаг шпилек по вертикали</param>
 /// <param name="widthHor">Ширина распределения по гориз</param>
 /// <param name="widthVertic">Ширина распр по вертик</param>
 /// <param name="pos">Позиция (из атр блока)</param>
 /// <param name="block">Блок</param>
 public Spring(int diam, int lRab, int stepHor, int stepVert, int widthHor, int widthVertic, string pos, ISpecBlock block)
     : base(diam, GetLength(lRab, diam), 1, PREFIX, pos, block, friendlyName)
 {
     Step            = stepHor;
     this.stepVertic = stepVert;
     //descEnd = $", ш.{stepHor}х{stepVert}";
     tail  = getTail(diam);
     LRab  = RoundHelper.Round5(lRab);
     Class = ClassA240C;
     Gost  = GostOld;
     Count = CalcCountByArea(widthHor, widthVertic, stepHor, stepVert);
     Key   = GetName() + "t" + tail + "lr" + LRab;
 }
Ejemplo n.º 27
0
 public Door(string mark, int lenght, int height, string elevation, string role, string desc, ISpecBlock specBlock)
     : base(0, "ДП-", mark, lenght, height, elevation, role, desc, specBlock)
 {
     Group = ApertureOptions.GroupDoor;
 }
Ejemplo n.º 28
0
 public Window(string mark, int lenght, int height, string elevation, string role, string desc, ISpecBlock specBlock)
     : base(1, "ОП-", mark, lenght, height, elevation, role, desc, specBlock)
 {
     Group = ApertureOptions.GroupWindow;
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Хомут
 /// </summary>
 /// <param name="diam">Диаметр</param>
 /// <param name="wShackle">Ширина хомута (по внутр гряням)</param>
 /// <param name="hShackle">Высота хомута</param>
 /// <param name="step">Шаг</param>
 /// <param name="range">Ширина распределения</param>
 /// <param name="pos">Значение атр позиции из блока</param>
 /// <param name="block">Блок</param>
 public Shackle(int diam, int wShackle, int hShackle, int step, int range, int rows, string pos, ISpecBlock block)
     : base(diam, GetLenShackle(wShackle, hShackle, diam), range, step, rows, PREFIX, pos, block, friendlyName)
 {
     tail  = getTail(diam);
     L     = RoundHelper.Round5(wShackle);
     H     = RoundHelper.Round5(hShackle);
     Class = ClassA240C;
     Gost  = GostOld;
     Key   = GetName() + "t" + tail + "L" + L + "h" + H;
 }
Ejemplo n.º 30
0
 /// <summary>
 /// Гнутый стержень распределенный по ширина с шагом
 /// </summary>
 public BentBarLshaped(int diam, int lGs, int hGs, int width, int step, int rows, string pos, ISpecBlock block)
     : base(diam, getLength(lGs, hGs, diam), width, step, rows, PREFIX, pos, block, friendlyName)
 {
     H = hGs;
     L = lGs;
     //descEnd = ", ш." + step;
     Key += "h" + H + "l" + L;
 }