Esempio n. 1
0
        public static List <CeilingPanel> GetAll(int floor)
        {
            var list = new List <CeilingPanel>();

            var layerIds = CeilingPanel.GetLayers();

            foreach (var layerId in layerIds)
            {
                var layerName = AutoCad.Db.LayerTableRecord.GetLayerName(layerId);
                if (layerName.Contains(Const.Layer.電気_天井パネル補足))
                {
                    continue;
                }

                var lines = Filters.GetCeilingPanelLineIds(layerName);
                if (lines.Count == 0)
                {
                    continue;
                }

                if (2 <= lines.Count)
                {
                    throw new ApplicationException("There are 2 or more ceiling panel lines for " + layerName);
                }

                var panel = new CeilingPanel(floor, layerName, lines[0]);

                list.Add(panel);
            }

            list.Sort((a, b) => a.Name.CompareTo(b.Name));

            return(list);
        }
Esempio n. 2
0
        /// <summary>天井パネルの表示状態を切り替える</summary>
        public static void ChangeVisibleOfCeilingPanel()
        {
            var layers = CeilingPanel.GetLayers();

            if (layers.Count == 0)
            {
                return;
            }

            var isFrozen = AutoCad.Db.LayerTableRecord.IsFrozen(layers[0]);

            ViewController.ChangeVisibleOfCeilingPanel(isFrozen);
        }
Esempio n. 3
0
        /// <summary>天井パネルを指定した表示状態にする</summary>
        public static void ChangeVisibleOfCeilingPanel(bool isVisible)
        {
            AutoCad.Command.Prepare();
            AutoCad.Command.SetCurrentLayer("0"); //現在の画層をフリーズすることはできないので。

            var layers = CeilingPanel.GetLayers();

            foreach (var layerid in layers)
            {
                AutoCad.Db.LayerTableRecord.SetFrozen(layerid, !isVisible);
            }

            AutoCad.Command.RefreshEx();
        }