Пример #1
0
        private void digestAreaEntry(object sender)
        {
            System.Windows.Controls.TextBox tb = sender as System.Windows.Controls.TextBox;
            string   strNewOpArea = tb.Text;
            UnitType clipUnit     = UnitType.UT_Area;
            Units    thisDocUnits = _doc.GetUnits();
            double   userNewOpArea;

            UnitFormatUtils.TryParse(thisDocUnits, clipUnit, strNewOpArea,
                                     out userNewOpArea);
            switch (tb.Name)
            {
            case "pfXOpArea":
                YOpDist          = userNewOpArea / XOpDist;
                pfYdistance.Text = AsRevitDistanceFormat(YOpDist);
                break;

            case "pfYOpArea":
                XOpDist          = userNewOpArea / YOpDist;
                pfXdistance.Text = AsRevitDistanceFormat(XOpDist);
                break;

            default:
                break;
            }
            CalcOpArea();
            UpdateOpAreas();
            tb.CaretIndex = tb.Text.Length;  /// reset cursor to end of text
        }
Пример #2
0
        private string FormatBoundedValue(IFCPropertyValue propertyValue)
        {
            if (IFCUnit != null)
            {
                FormatValueOptions formatValueOptions = new FormatValueOptions();
                FormatOptions      specFormatOptions  = IFCImportFile.TheFile.Document.GetUnits().GetFormatOptions(IFCUnit.Spec);
                specFormatOptions.Accuracy = 1e-8;
                if (specFormatOptions.CanSuppressTrailingZeros())
                {
                    specFormatOptions.SuppressTrailingZeros = true;
                }
                formatValueOptions.SetFormatOptions(specFormatOptions);

                // If ScaleValues is false, value is in source file units, but 'UnitFormatUtils.Format' expects
                // it in internal units and it then converts it to display units, which should be the same as
                // the source file units.
                double value = Importer.TheProcessor.ScaleValues ?
                               propertyValue.AsDouble() :
                               UnitUtils.ConvertToInternalUnits(propertyValue.AsDouble(), specFormatOptions.GetUnitTypeId());

                return(UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), IFCUnit.Spec, value, false, formatValueOptions));
            }
            else
            {
                return(propertyValue.ValueAsString());
            }
        }
        private void Window_Closing(object sender,
                                    System.ComponentModel.CancelEventArgs e)
        {
            String pfc = this.pfClip.Text;

            try
            {
                UnitType clipUnit     = UnitType.UT_Length;
                Units    thisDocUnits = _doc.GetUnits();
                double   userFarClipSetting;
                UnitFormatUtils.TryParse(thisDocUnits,
                                         clipUnit, pfc, out userFarClipSetting);
                Properties.Settings.Default.PreferFarClip = userFarClipSetting;
            }
            catch (Exception)
            {
                MessageBox.Show("For some unknown reason.\n\nNo change was made.",
                                "Settings Error");
            }
            Properties.Settings.Default.FormFarClip_Top  = this.Top;
            Properties.Settings.Default.FormFarClip_Left = this.Left;
            Properties.Settings.Default.FormFarClip_HT   = this.Height;
            Properties.Settings.Default.FormFarClip_WD   = this.Width;
            Properties.Settings.Default.Save();
        }
Пример #4
0
        bool IsParsed(string valParse, out double OutParse)
        {
            Units vUnits  = _Doc.GetUnits();
            bool  vResult = UnitFormatUtils.TryParse(vUnits, UnitType.UT_Length, valParse, out OutParse);

            return(vResult);
        }
Пример #5
0
        protected override void Process(IFCAnyHandle ifcCurve)
        {
            base.Process(ifcCurve);

            bool   found  = false;
            double radius = IFCImportHandleUtil.GetRequiredScaledLengthAttribute(ifcCurve, "Radius", out found);

            if (!found)
            {
                Importer.TheLog.LogError(ifcCurve.StepId, "Cannot find the radius of this circle", false);
                return;
            }

            try
            {
                Curve = Arc.Create(Position.Origin, radius, 0, 2.0 * Math.PI, Position.BasisX, Position.BasisY);
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("too small"))
                {
                    string lengthAsString = UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), UnitType.UT_Length, radius, true, false);
                    Importer.TheLog.LogError(Id, "Found a circle with radius of " + lengthAsString + ", ignoring.", false);
                    Curve = null;
                }
                else
                {
                    Importer.TheLog.LogError(Id, ex.Message, false);
                }
                Curve = null;
            }
        }
Пример #6
0
        private string ConvertFeetInchToString(double feetInch)
        {
            Units  units  = this.doc.GetUnits();
            string output = UnitFormatUtils.Format(units, UnitType.UT_Length, feetInch, true, true);

            return(output);
        }
Пример #7
0
        static public string FormatToRevitUI(string valueName, double value, UnitsAssignment[] Assignments, bool appendUnitSymbol = false)
        {
            string formatedValue = value.ToString();

            if (null == RevitUnits)
            {
                return(formatedValue);
            }

            foreach (UnitsAssignment ua in Assignments)
            {
                if (ua.ValueName.CompareTo(valueName) == 0)
                {
                    FormatOptions fo = RevitUnits.GetFormatOptions(ua.unitType);

                    FormatValueOptions formatValueOptions = new FormatValueOptions();
                    formatValueOptions.SetFormatOptions(fo);
                    formatValueOptions.AppendUnitSymbol = appendUnitSymbol;

                    formatedValue = UnitFormatUtils.FormatValueToString(RevitUnits, ua.unitType, value, false, false, formatValueOptions);

                    string unitSymbol = GetUnitSymbol(valueName, Assignments);
                    if (unitSymbol.Length > 0)
                    {
                        formatedValue = Regex.Replace(formatedValue, unitSymbol, "");
                    }
                    break;
                }
            }

            return(formatedValue);
        }
Пример #8
0
        static public string FormatLengthAsString(double value)
        {
            FormatValueOptions formatValueOptions = new FormatValueOptions();

            formatValueOptions.AppendUnitSymbol = true;
            return(UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), UnitType.UT_Length, value, true, false, formatValueOptions));
        }
Пример #9
0
        /// <summary>
        /// Executed upon existing the param_expr rule
        /// </summary>
        /// <param name="context">the param_expr context</param>
        public override void ExitParam_expr([NotNull] ParamExprGrammarParser.Param_exprContext context)
        {
            base.ExitParam_expr(context);
            NodeProperty paramExprNodeProp = GetNodePropertyValue(context.expr());
            object       parValue          = paramExprNodeProp.nodePropertyValue;

            // Unique parameter value can only be "enforced" for a string datatype by appending a running number: <parValue> (#), starting with 2
            if (isUnique && parValue is string)
            {
                Tuple <string, object> key = new Tuple <string, object>(RevitParameterName, parValue);
                int counter = 0;
                if (UniqueParameterValue.TryGetValue(key, out counter))
                {
                    counter++;
                    parValue = parValue.ToString() + " (" + counter.ToString() + ")";
                    UniqueParameterValue[key] = counter;
                }
                else
                {
                    UniqueParameterValue.Add(key, 1);
                }
            }
            FinalParameterValue = parValue;
            UnitType            = paramExprNodeProp.uomTypeId;
            if (paramExprNodeProp.uomTypeId != null)
            {
                if (FinalParameterValue is double)
                {
                    double?paramValueDouble = FinalParameterValue as double?;
                    formattedValue      = UnitFormatUtils.Format(RevitElement.Document.GetUnits(), paramExprNodeProp.uomTypeId, paramValueDouble.Value, false);
                    FinalParameterValue = UnitUtils.ConvertToInternalUnits(paramValueDouble.Value, paramExprNodeProp.uomTypeId);
                }
            }
        }
Пример #10
0
        private void digestMaxAreaCBoxChange(object sender)
        {
            System.Windows.Controls.ComboBox cb = sender as System.Windows.Controls.ComboBox;
            string   strNewOpArea = cb.Text;
            UnitType clipUnit     = UnitType.UT_Area;
            Units    thisDocUnits = _doc.GetUnits();
            double   userNewMaxOpArea;

            UnitFormatUtils.TryParse(thisDocUnits, clipUnit, strNewOpArea,
                                     out userNewMaxOpArea);
            switch (cb.Name)
            {
            case "XOpMaxA":
                pfXOpArea.Text = userNewMaxOpArea.ToString();
                digestAreaEntry(pfXOpArea);
                YOpMaxA.Text = cb.Text;
                break;

            case "YOpMaxA":
                pfYOpArea.Text = userNewMaxOpArea.ToString();
                digestAreaEntry(pfYOpArea);
                XOpMaxA.Text = cb.Text;
                break;

            default:
                break;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        private bool TryGetValue(string value, out double?result)
        {
            result = null;
            var s     = string.Empty;
            var match = Regex.Match(value, @"^[0-9\'\-\/\""\s]*", RegexOptions.IgnoreCase);

            if (match.Success)
            {
                s = match.Value.Trim();
            }

            if (string.IsNullOrEmpty(s))
            {
                return(false);
            }

            var verify = Regex.Match(s, @"^[0-9\'\-\/\""\s]*$", RegexOptions.IgnoreCase);

            if (!verify.Success)
            {
                return(false);
            }

            if (!UnitFormatUtils.TryParse(_doc.GetUnits(), UnitType.UT_Length, s,
                                          new ValueParsingOptions(),
                                          out var second))
            {
                return(false);
            }

            result = second;
            return(true);
        }
Пример #12
0
            public static bool GetLengthInput(Document document, String userInputLength, out double dParsedLength)
            {
                dParsedLength = 0;
                Units units = document.GetUnits();

                // try to parse a user entered string (i.e. 100 mm, 1'6")
                return(UnitFormatUtils.TryParse(units, UnitType.UT_Length, userInputLength, out dParsedLength));
            }
Пример #13
0
            public static double String_FeetandInch2Double(Document Document, string FeetandInchs)
            {
                double dParsedLength = 0;
                Units  units         = Document.GetUnits();

                UnitFormatUtils.TryParse(units, UnitType.UT_Length, FeetandInchs, out dParsedLength);
                return(dParsedLength);
            }
Пример #14
0
        //private static string GetParamaterUnit(DisplayUnitType uniType)
        //{
        //    switch (uniType)
        //    {
        //        case DisplayUnitType.DUT_MILLIMETERS:
        //            return "mm";
        //        case DisplayUnitType.DUT_METERS:
        //            return "m";
        //        case DisplayUnitType.DUT_CENTIMETERS:
        //            return "cm";
        //        default:
        //            return string.Empty;
        //    }
        //}

        private static string FormatNumber(Document doc, UnitType unitType, double value)
        {
#if R2014
            var uStr = FormatUtils.Format(doc, unitType, value);
#else
            var uStr = UnitFormatUtils.Format(doc.GetUnits(), unitType, value, false, false);
#endif
            return(uStr);
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     this.pfClip.Text = UnitFormatUtils.Format(
         _doc.GetUnits(),
         UnitType.UT_Length,
         Properties.Settings.Default.PreferFarClip,
         false,
         false);
 }
Пример #16
0
        private string GenerateShortDistanceCommentString(double dist, double shortSegmentTolerance, int lastVertex, int currIdx, bool tryAsSolid)
        {
            string distAsString      = UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), UnitType.UT_Length, dist, true, false);
            string shortDistAsString = UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), UnitType.UT_Length, shortSegmentTolerance, true, false);
            string warningString     = "Distance between vertices " + lastVertex + " and " + currIdx +
                                       " is " + distAsString + ", which is less than the minimum " + (tryAsSolid ? "Solid" : "Mesh") +
                                       " distance of " + shortDistAsString + ", removing second point.";

            return(warningString);
        }
Пример #17
0
        public static string ParameterToString(Document doc, FamilyParameter param, FamilyType type)
        {
            if (!type.HasValue(param))
            {
                return("无");
            }
            if (param.Definition.ParameterType == ParameterType.Invalid)
            {
                return("不可用");
            }
            switch (param.StorageType)
            {
            case StorageType.Double:
#if R2014
                var uStr = FormatUtils.Format(doc, param.Definition.UnitType, type.AsDouble(param).Value);
#else
                var uStr = UnitFormatUtils.Format(doc.GetUnits(), param.Definition.UnitType, type.AsDouble(param).Value, false, false);
#endif
                return(uStr);

            //var uStr = string.Empty;
            //if (param.Definition.ParameterType == ParameterType.Length)
            //{
            //    uStr = GetParamaterUnit(param.DisplayUnitType);
            //}
            //var dStr = param.AsValueString();
            //if (!String.IsNullOrEmpty(uStr) && !dStr.EndsWith(uStr)) dStr += uStr;
            //return dStr;
            case StorageType.Integer:
                var v = type.AsInteger(param).Value;
                if (param.Definition.ParameterType == ParameterType.YesNo)
                {
                    if (v == 0)
                    {
                        return("否");
                    }
                    return("是");
                }
#if R2014
                return(FormatUtils.Format(doc, param.Definition.UnitType, v));
#else
                return(UnitFormatUtils.Format(doc.GetUnits(), param.Definition.UnitType, v, false, false));
#endif
            case StorageType.String:
                return(type.AsString(param));

            case StorageType.ElementId:
                ElementId idVal = type.AsElementId(param);
                return(AsElementName(doc, idVal));

            case StorageType.None:
            default:
                return("无");
            }
        }
Пример #18
0
 private string FormatBoundedValue(IFCPropertyValue propertyValue)
 {
     if (IFCUnit != null)
     {
         return(UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), IFCUnit.UnitType, propertyValue.AsDouble(), true, false));
     }
     else
     {
         return(propertyValue.ValueAsString());
     }
 }
Пример #19
0
        private static string FormatDatumOffsetString(DatumPlane datum, double offset, Units docUnits)
        {
            if (datum == null)
            {
                return(UnitFormatUtils.Format(docUnits, 0, offset, false, false));
            }
            double num  = Math.Abs(offset);
            bool   flag = offset < 0.0;

            return("(" + datum.get_Name() + ")" + (flag ? " - " : " + ") + UnitFormatUtils.Format(docUnits, 0, num, false, false));
        }
Пример #20
0
        private double ConvertStringToFeetInch(string feetInchString)
        {
            double feetInch = 0;

            Units units = this.doc.GetUnits();

            if (!UnitFormatUtils.TryParse(units, UnitType.UT_Length, feetInchString, out feetInch))
            {
                throw new FormatException();
            }

            return(feetInch);
        }
Пример #21
0
        public void PE_ShouldFormatText()
        {
            //Arrange
            double   d        = 5.726548;
            Document doc      = GeneralHelper.ExternalCommandData.Application.ActiveUIDocument.Document;
            Units    docUnits = doc.GetUnits();

            //Act
            string output = UnitFormatUtils.Format(docUnits, UnitType.UT_Length, d, false, true);

            //Assert
            Assert.AreEqual(output, "5\'  8 23/32\"");
        }
Пример #22
0
 private void Height_TextBox_LostFocus(object sender, RoutedEventArgs e)
 {
     if (Tools.GetValueFromString(Height_TextBox.Text, _doc.GetUnits()) != null)
     {
         _floorHeight        = (double)Tools.GetValueFromString(Height_TextBox.Text, _doc.GetUnits());
         Height_TextBox.Text = UnitFormatUtils.Format(_doc.GetUnits(), UnitType.UT_Length, _floorHeight, true, true);
     }
     else
     {
         TaskDialog.Show(Tools.LangResMan.GetString("floorFinishes_TaskDialogName", Tools.Cult),
                         Tools.LangResMan.GetString("floorFinishes_heightValueError", Tools.Cult), TaskDialogCommonButtons.Close, TaskDialogResult.Close);
         this.Activate();
     }
 }
Пример #23
0
        public static double?GetValueFromString(string text, Units units)
        {
            // Check the string value
            var heightValueString = text;

            if (UnitFormatUtils.TryParse(units, UnitType.UT_Length, heightValueString, out double length))
            {
                return(length);
            }
            else
            {
                return(null);
            }
        }
Пример #24
0
        /// <summary>
        /// Convert a value into a formatted length string as displayed in Revit.
        /// </summary>
        /// <param name="value">The value, in Revit internal units.</param>
        /// <returns>The formatted string representation.</returns>
        static public string FormatLengthAsString(double value)
        {
            FormatValueOptions formatValueOptions = new FormatValueOptions();

            formatValueOptions.AppendUnitSymbol = true;
            FormatOptions lengthFormatOptions = IFCImportFile.TheFile.Document.GetUnits().GetFormatOptions(SpecTypeId.Length);

            lengthFormatOptions.Accuracy = 1e-8;
            if (lengthFormatOptions.CanSuppressTrailingZeros())
            {
                lengthFormatOptions.SuppressTrailingZeros = true;
            }
            formatValueOptions.SetFormatOptions(lengthFormatOptions);
            return(UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), SpecTypeId.Length, value, false, formatValueOptions));
        }
        /// <summary>
        /// Gets initial items for ComboBox in settings dialog.
        /// </summary>
        /// <param name="history">
        /// The list containing the settings history.
        /// </param>
        /// <param name="initialValue">
        /// The initial value to be add to ComboBox.
        /// </param>
        /// <returns>
        /// Initial numeric items for ComboBox.
        /// </returns>
        public static string[] GetInitialItemsForComboBox(List <double> history, double initialValue, Units unit, UnitType unitType)
        {
            UpdateHistory(history, initialValue);

            List <string> strCopyHistory = new List <string>();

            foreach (double item in history)
            {
                if (double.IsNaN(item))
                {
                    continue;
                }

                strCopyHistory.Add(UnitFormatUtils.FormatValueToString(unit, unitType, item, false, false));
            }
            return(strCopyHistory.ToArray());
        }
        public static string ConVertDoubleToImperial(double doubleLength)
        {
            string   empty    = string.Empty;
            double   num      = UnitUtils.Convert(doubleLength, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_FEET_FRACTIONAL_INCHES);
            Units    units    = new Units(UnitSystem.Imperial);
            UnitType unitType = UnitType.UT_Length;
            string   text     = UnitFormatUtils.Format(units, unitType, doubleLength, true, true);
            int      num2     = text.IndexOf("'");
            string   text2    = text;

            text2 = text2.Remove(num2, text.Length - num2);
            text  = text.Remove(0, num2 + 1).Trim();
            num2  = text.IndexOf("\"");
            string str = text.Remove(num2, text.Length - num2);

            return(text2 + "'" + "-" + str + "\"");
        }
Пример #27
0
        private void pfArry_LostFocus(object sender, RoutedEventArgs e)
        {
            System.Windows.Controls.TextBox tb = sender as System.Windows.Controls.TextBox;
            String   pfc          = tb.Text;
            UnitType clipUnit     = UnitType.UT_Number;
            Units    thisDocUnits = _doc.GetUnits();
            double   userDistance;

            UnitFormatUtils.TryParse(thisDocUnits, clipUnit, pfc,
                                     out userDistance);
            if (userDistance > 1)
            {
                tb.Text = Convert.ToInt32(userDistance).ToString();
            }
            else
            {
                tb.Text = "2";
            }
        }
Пример #28
0
 private string FormatBoundedValue(IFCPropertyValue propertyValue)
 {
     if (IFCUnit != null)
     {
         FormatValueOptions formatValueOptions = new FormatValueOptions();
         FormatOptions      specFormatOptions  = IFCImportFile.TheFile.Document.GetUnits().GetFormatOptions(IFCUnit.Spec);
         specFormatOptions.Accuracy = 1e-8;
         if (specFormatOptions.CanSuppressTrailingZeros())
         {
             specFormatOptions.SuppressTrailingZeros = true;
         }
         formatValueOptions.SetFormatOptions(specFormatOptions);
         return(UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), IFCUnit.Spec, propertyValue.AsDouble(), false, formatValueOptions));
     }
     else
     {
         return(propertyValue.ValueAsString());
     }
 }
Пример #29
0
        //public void application_Sync(object sender, DocumentSynchronizingWithCentralEventArgs args)
        //{
        //    Document doc = args.Document;
        //progress.Report(doc);
        //}
        public void getdoc(object sender, ViewActivatedEventArgs args)
        {
            doc = args.Document;
            ComboBoxMemberData Range1 = new ComboBoxMemberData("0", "1/2\"");
            ComboBoxMemberData Range2 = new ComboBoxMemberData("1", "1\"");
            ComboBoxMemberData Range3 = new ComboBoxMemberData("2", "3\"");
            ComboBoxMemberData Range4 = new ComboBoxMemberData("3", "1' 0\"");
            ComboBoxMemberData Range5 = new ComboBoxMemberData("4", "3' 0\"");
            ComboBoxMemberData Range6 = new ComboBoxMemberData("5", "10' 0\"");

            if (doc.DisplayUnitSystem == DisplayUnit.IMPERIAL)
            {
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1/2\"", out StoreExp.vrOpt1);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1\"", out StoreExp.vrOpt2);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "3\"", out StoreExp.vrOpt3);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1'0\"", out StoreExp.vrOpt4);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "3'0\"", out StoreExp.vrOpt5);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "10'0\"", out StoreExp.vrOpt6);
            }
            else
            {
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1 cm", out StoreExp.vrOpt1);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "2 cm", out StoreExp.vrOpt2);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "10 cm", out StoreExp.vrOpt3);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "30 cm", out StoreExp.vrOpt4);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "90 cm", out StoreExp.vrOpt5);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "300 cm", out StoreExp.vrOpt6);
                Range1.Text = "1 cm"; Range2.Text = "2 cm"; Range3.Text = "10 cm";
                Range4.Text = "30 cm"; Range5.Text = "90 cm"; Range6.Text = "300 cm";
            }
            UiCtrApp.ViewActivated -= getdoc;
            foreach (RibbonItem item in panel_ViewSetup.GetItems())
            {
                if (item.Name == "ShiftRange")
                {
                    ComboBox ShiftRange_CB = (ComboBox)item;
                    ShiftRange_CB.AddItem(Range1); ShiftRange_CB.AddItem(Range2);
                    ShiftRange_CB.AddItem(Range3); ShiftRange_CB.AddItem(Range4);
                    ShiftRange_CB.AddItem(Range5); ShiftRange_CB.AddItem(Range6);
                }
            }
            doc = null;
        }
Пример #30
0
        private void SaveCurrentState()
        {
            String pfXop = pfXdistance.Text;
            String pfYop = pfYdistance.Text;
            String pfXa  = pfXArry.Text;
            String pfYa  = pfYArry.Text;

            try {
                UnitType opDistUnit   = UnitType.UT_Length;
                Units    thisDocUnits = _doc.GetUnits();

                double userX_OpDistance;
                UnitFormatUtils.TryParse(thisDocUnits, opDistUnit, pfXop, out userX_OpDistance);
                Properties.Settings.Default.X_OpDistance = userX_OpDistance;

                double userY_OpDistance;
                UnitFormatUtils.TryParse(thisDocUnits, opDistUnit, pfYop, out userY_OpDistance);
                Properties.Settings.Default.Y_OpDistance = userY_OpDistance;

                int XArry = Int32.Parse(pfXa);
                int YArry = Int32.Parse(pfYa);

                Properties.Settings.Default.X_ARY_QTY = XArry;
                Properties.Settings.Default.Y_ARY_QTY = YArry;

                Properties.Settings.Default.OpArea   = XOpMaxA.Text;
                Properties.Settings.Default.MaxSpace = MaxSpace.Text;

                Properties.Settings.Default.FormOps_Top  = Top;
                Properties.Settings.Default.FormOps_Left = Left;

                Properties.Settings.Default.SeeSmallRoom = (bool)SeeSmallRoom.IsChecked;
                Properties.Settings.Default.SeeMinDist   = (bool)SeeMinDist.IsChecked;

                //MessageBox.Show(Properties.Settings.Default.SeeSmallRoom.ToString() + "  |  " + Properties.Settings.Default.SeeMinDist.ToString());

                Properties.Settings.Default.Save();
            } catch (Exception) {
                MessageBox.Show("For some unknown reason.\n\nNo settings saved.",
                                "Settings Error");
            }
        }