Esempio n. 1
0
        public StartOption PromptStartOptions()
        {
            StartOption resVal = this;
            //Запрос начальных значений
            FormStartOptions formStartOptions = new FormStartOptions((StartOption)resVal.MemberwiseClone());

            if (Application.ShowModalDialog(formStartOptions) != System.Windows.Forms.DialogResult.OK)
            {
                throw new System.Exception(AcadLib.General.CanceledByUser);
            }
            try
            {
                resVal = formStartOptions.StartOptions;
                saveAbbreviateName(resVal.Abbr);
                saveNumberToDict(resVal.NumberFirstFloor, Album.KEYNAMENUMBERFIRSTFLOOR);
                saveNumberToDict(resVal.NumberFirstSheet, Album.KEYNAMENUMBERFIRSTSHEET);
                saveNumberToDict(resVal.NumberAddSheetContent, Album.KEYNAMENUMBERADDSHEETCONTENT);
                DictNOD.SaveBool(resVal.CheckMarkPainting, Album.KEYNAMECHECKMARKPAINTING);
                DictNOD.SaveBool(resVal.IsTileArticle, Album.KEYNAMEISTILEARTICLE);
                //DictNOD.SaveBool(resVal.SortPanels, Album.KEYNAMESORTPANELS);
                //DictNOD.SaveBool(resVal.NewMode, Album.KEYNAMENEWMODE);
                //DictNOD.SaveBool(resVal.EndsInPainting, Album.KEYNAMEENDSINPAINTING);
                //DictNOD.SaveString(resVal.SplitIndexPainting, Album.KEYNAMESPLITINDEXPAINTING);
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex, "Не удалось сохранить стартовые параметры.");
            }
            return(resVal);
        }
Esempio n. 2
0
 public Album()
 {
     _doc         = Application.DocumentManager.MdiActiveDocument;
     _db          = _doc.Database;
     Date         = DateTime.Now;
     StartOptions = new StartOption();
     StartOptions.LoadDefault();
 }
Esempio n. 3
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();
            });
        }
 public FormStartOptions(StartOption startOptions)
 {
     StartOptions = startOptions;
     InitializeComponent();
     propertyGrid1.SelectedObject = StartOptions;
 }