Example #1
0
        public PanelBase(Panel panelXml, BaseService service, MountingPanel panelMount = null)
        {
            Panel   = panelXml;
            Service = service;

            MarkWithoutElectric = AkrHelper.GetMarkWithoutElectric(Panel.mark);

            Length = panelXml.gab.length;
            Height = panelXml.gab.height;

            XMinContour = 0;
            XMaxContour = Length;

            XMinPanel     = 0;
            XMaxPanel     = Length;
            LengthByTiles = Length;

            Thickness = getThickness(panelXml, panelMount);

            setNLayerPanel();
            IsOL = Panel.mark.StartsWith("ол", StringComparison.OrdinalIgnoreCase);
            IsUpperStoreyPanel = defineIsUpperStoreyPanel();

            HasWindows = Panel.windows?.window?.Count() > 0;
        }
Example #2
0
        public PanelBase(Panel panelXml, BaseService service, MountingPanel panelMount = null)
        {
            Panel = panelXml;
             Service = service;

             MarkWithoutElectric = AkrHelper.GetMarkWithoutElectric(Panel.mark);

             Length = panelXml.gab.length;
             Height = panelXml.gab.height;

             XMinContour = 0;
             XMaxContour = Length;

             XMinPanel = 0;
             XMaxPanel = Length;
             LengthByTiles = Length;

             Thickness = getThickness (panelXml, panelMount);

             setNLayerPanel();
             IsOL = Panel.mark.StartsWith("ол", StringComparison.OrdinalIgnoreCase);
             IsUpperStoreyPanel = defineIsUpperStoreyPanel();

             HasWindows = Panel.windows?.window?.Count() > 0;
        }
Example #3
0
        public Panel GetPanelXml(string markSb, MountingPanel panelMount = null)
        {
            Panel panel;

            if (!_panelsXML.TryGetValue(markSb.ToUpper(), out panel))
            {
                // Если это панель с классом бетона 2, то найти панель без индекса класса (3НСНг2 75.29.42-6 - 3НСНг 75.29.42-6 - геометрически одинаковые)
                int indexConcreteClass = panelMount != null ? panelMount.IndexConcreteClass : MountingPanel.DefineIndexConcreteClass(markSb);
                if (indexConcreteClass > 0)
                {
                    string markSbWoConcreteClass = MountingPanel.GetMarkWoConcreteClass(markSb);
                    panel = GetPanelXml(markSbWoConcreteClass, panelMount);
                    if (panel != null)
                    {
                        panel.mark = markSb;
                    }
                    return(panel);
                }
            }
            if (panel == null)
            {
                // Ошибка - панели с такой маркой нет в базе
                if (panelMount == null)
                {
                    Inspector.AddError($"Панели с такой маркой нет в базе - {markSb}", icon: System.Drawing.SystemIcons.Error);
                }
                else
                {
                    Inspector.AddError($"Панели с такой маркой нет в базе - {markSb}", panelMount.ExtTransToModel, panelMount.IdBlRef,
                                       icon: System.Drawing.SystemIcons.Error);
                }
            }
            return(panel);
        }
Example #4
0
        public EplanMountingPanelViewModel(MountingPanel mountingPanel)
        {
            if (mountingPanel == null)
            {
                throw new ArgumentNullException(nameof(mountingPanel));
            }

            this._mountingPanel = mountingPanel;
        }
Example #5
0
        private int getThickness(Panel panelXml, MountingPanel panelMount = null)
        {
            int resVal = 0;

            if (panelMount != null && panelMount.Thickness > 0)
            {
                // Может быть неточная.
                resVal = panelMount.Thickness;
            }
            else
            {
                // Пока задам по-умолчанию 320. В описании панели в xml должна скоро появиться толщина
                resVal = 320;
            }
            return(resVal);
        }
Example #6
0
        public void AKR_RemoveMarkPaintingFromMountingPanels()
        {
            CommandStart.Start(doc =>
            {
                Editor ed   = doc.Editor;
                Database db = doc.Database;

                try
                {
                    var startOptions = new StartOption();
                    startOptions.LoadDefault();
                    if (startOptions.CheckMarkPainting)
                    {
                        MessageBox.Show("Для чертежа включена проверка марок покраски панелей. Нельзя выполнять очистку!",
                                        "АКР. Очистка марок покраски в монтажных панелях.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                catch { }

                using (var t = db.TransactionManager.StartTransaction())
                {
                    // Все монтажные блоки панелей в модели
                    var ms = SymbolUtilityServices.GetBlockModelSpaceId(db).GetObject(OpenMode.ForRead) as BlockTableRecord;
                    var mountingsPanelsInMs = MountingPanel.GetPanels(ms, Point3d.Origin, Matrix3d.Identity, null, null);
                    mountingsPanelsInMs.ForEach(p => p.RemoveMarkPainting());
                    foreach (ObjectId idEnt in ms)
                    {
                        if (idEnt.IsValidEx() && idEnt.ObjectClass.Name == "AcDbBlockReference")
                        {
                            var blRefMounting = t.GetObject(idEnt, OpenMode.ForRead, false, true) as BlockReference;
                            if (blRefMounting.Name.StartsWith(Settings.Default.BlockPlaneMountingPrefixName, StringComparison.CurrentCultureIgnoreCase))
                            {
                                var btr             = blRefMounting.BlockTableRecord.GetObject(OpenMode.ForRead) as BlockTableRecord;
                                var mountingsPanels = MountingPanel.GetPanels(btr, blRefMounting.Position, blRefMounting.BlockTransform, null, null);
                                mountingsPanels.ForEach(p => p.RemoveMarkPainting());
                            }
                        }
                    }
                    t.Commit();
                }
                ed.Regen();
            });
        }
Example #7
0
        public static FloorRow GetFloorRow(MountingPanel panelMount)
        {
            var fr = ChangeJobService.FloorRows.Find(f => f.Storey == panelMount.Floor.Storey);

            if (fr == null)
            {
                // Нет еще такого этажа, добавление
                fr = new  FloorRow(panelMount);
                ChangeJobService.FloorRows.Add(fr);
            }
            else
            {
                // Проверка длины и высоты
                var hey = panelMount.Floor.PlanExtentsHeight;
                if (hey > fr.HeightMax)
                {
                    fr.HeightMax = hey;
                }
            }
            return(fr);
        }
        public static SectionColumn GetSectionColumn(MountingPanel panelMount)
        {
            var sec = ChangeJobService.SecCols.Find(s => s.Section == panelMount.Floor.Section);

            if (sec == null)
            {
                // Нет еще такой секции, добавление
                sec = new SectionColumn(panelMount);
                ChangeJobService.SecCols.Add(sec);
            }
            else
            {
                // Проверка длины и высоты
                var len = panelMount.Floor.PlanExtentsLength;
                if (len > sec.LengthMax)
                {
                    sec.LengthMax = len;
                }
            }
            return(sec);
        }
Example #9
0
 public Panel GetPanelXml(string markSb, MountingPanel panelMount = null)
 {
     Panel panel;
      if (!_panelsXML.TryGetValue(markSb.ToUpper(), out panel))
      {
     // Если это панель с классом бетона 2, то найти панель без индекса класса (3НСНг2 75.29.42-6 - 3НСНг 75.29.42-6 - геометрически одинаковые)
     int indexConcreteClass = panelMount != null ? panelMount.IndexConcreteClass : MountingPanel.DefineIndexConcreteClass(markSb);
     if (indexConcreteClass > 0)
     {
        string markSbWoConcreteClass = MountingPanel.GetMarkWoConcreteClass(markSb);
        panel = GetPanelXml(markSbWoConcreteClass, panelMount);
        if (panel !=null)
        {
           panel.mark = markSb;
        }
        return panel;
     }
      }
      if (panel == null)
      {
     // Ошибка - панели с такой маркой нет в базе
     if (panelMount == null)
     {
        Inspector.AddError($"Панели с такой маркой нет в базе - {markSb}", icon: System.Drawing.SystemIcons.Error);
     }
     else
     {
        Inspector.AddError($"Панели с такой маркой нет в базе - {markSb}", panelMount.ExtTransToModel, panelMount.IdBlRef,
           icon: System.Drawing.SystemIcons.Error);
     }
      }
      return panel;
 }
Example #10
0
 public FloorRow(MountingPanel panelMount)
 {
     Storey    = panelMount.Floor.Storey;
     HeightMax = panelMount.Floor.PlanExtentsHeight;
 }
Example #11
0
 public SectionColumn(MountingPanel panelMount)
 {
     Section   = panelMount.Floor.Section;
     LengthMax = panelMount.Floor.PlanExtentsLength;
 }
Example #12
0
        private void DefineBlocks(out List <Workspace> wsList, out List <Axis> axisList, out List <ObjectId> elemList,
                                  out RTree <object> treeElementsInWs)
        {
            wsList           = new List <Workspace>();
            axisList         = new List <Axis>();
            elemList         = new List <ObjectId>();
            treeElementsInWs = new RTree <object>();
            using (var t = db.TransactionManager.StartTransaction())
            {
                var ms = db.CurrentSpaceId.GetObject(OpenMode.ForRead) as BlockTableRecord;

                foreach (var item in ms)
                {
                    if (!item.IsValidEx())
                    {
                        continue;
                    }

                    var ent = item.GetObject(OpenMode.ForRead);

                    if (ent is BlockReference)
                    {
                        var blRef  = ent as BlockReference;
                        var blName = blRef.GetEffectiveName();
                        if (Workspace.IsWorkSpace(blName))
                        {
                            var ws = Workspace.Define(blRef);
                            if (ws != null)
                            {
                                wsList.Add(ws);
                            }
                        }
                        else if (Axis.IsBlockAxis(blName))
                        {
                            var axis = Axis.Define(blRef, blName);
                            if (axis != null)
                            {
                                axisList.Add(axis);
                                AddElementWsToTree(axis, axis.Bounds.Value, "Блок осей", ref treeElementsInWs);
                            }
                        }
                        else
                        {
                            List <AttributeRefDetail> attrsDet;
                            string mark;
                            string paint;
                            if (MountingPanel.IsMountingPanel(blRef, out mark, out paint, out attrsDet))
                            {
                                elemList.Add(item);
                                AddElementWsToTree(item, blRef.GeometricExtents, "Блок осей", ref treeElementsInWs);
                            }
                        }
                    }
                    else if (ent is DBText)
                    {
                        var text = ent as DBText;
                        if (IsTextScheme(text.TextString))
                        {
                            elemList.Add(item);
                            AddElementWsToTree(item, ent.Bounds.Value, "Блок осей", ref treeElementsInWs);
                        }
                    }
                    else if (ent is MText)
                    {
                        var mt = ent as MText;
                        if (IsTextScheme(mt.Text))
                        {
                            elemList.Add(item);
                            AddElementWsToTree(item, ent.Bounds.Value, "Блок осей", ref treeElementsInWs);
                        }
                    }
                }
                t.Commit();
            }
        }