private static bool GetPlotter(_AcEd.Editor ed) { var devList = GetDeviceList(); if (devList.Count == 0) { throw new InvalidOperationException("Es wurden keine Plotter gefunden!"); } _NoPlotterName = devList[0]; if (! ( (string.Compare(_NoPlotterName, "Kein", StringComparison.OrdinalIgnoreCase) == 0) || (string.Compare(_NoPlotterName, "None", StringComparison.OrdinalIgnoreCase) == 0) || (string.Compare(_NoPlotterName, "No", StringComparison.OrdinalIgnoreCase) == 0) )) { _NoPlotterName = "Kein"; } using (var frm = new GetPlotterName(devList)) { var res = _AcAp.Application.ShowModalDialog(frm); if (res == System.Windows.Forms.DialogResult.Cancel) { return(false); } _PlotterName = frm.CurrentPlotterName; _NoPlotterInModelSpace = frm.NoPlotterInModelspace; } //var prompt = new _AcEd.PromptStringOptions("\nPlotter-Name, der allen Layouts zugewiesen werden soll: "); //prompt.AllowSpaces = true; //while (string.IsNullOrEmpty(_PlotterName)) //{ // var res = ed.GetString(prompt); // if (res.Status != _AcEd.PromptStatus.OK) // { // return false; // } // _PlotterName = res.StringResult; //} return(true); }
private static bool GetCtbName(_AcEd.Editor ed) { var devList = GetCtbList(); _NoCtbName = ""; using (var frm = new GetPlotterName(devList)) { frm.Text = "CTB"; frm.chkModelToNone.Text = "Kein CTB im Modellbereich"; var res = _AcAp.Application.ShowModalDialog(frm); if (res == System.Windows.Forms.DialogResult.Cancel) { return(false); } _CtbName = frm.CurrentPlotterName; _NoCtbInModelSpace = frm.NoPlotterInModelspace; } if (string.Compare(_CtbName, "Keine", StringComparison.OrdinalIgnoreCase) == 0) { _CtbName = ""; } //var prompt = new _AcEd.PromptStringOptions("\nCTB-Name, der allen Layouts zugewiesen werden soll: "); //prompt.AllowSpaces = true; //while (string.IsNullOrEmpty(_CtbName)) //{ // var res = ed.GetString(prompt); // if (res.Status != _AcEd.PromptStatus.OK) // { // return false; // } // _CtbName = res.StringResult; // if (!_CtbName.EndsWith(".ctb", StringComparison.OrdinalIgnoreCase)) _CtbName += ".ctb"; //} return(true); }