Beispiel #1
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (radioButtonMethodIsBendDeduction.Checked && textBoxBendDeductionTableFile.Text.Length < 1)
            {
                MessageBox.Show(
                    Resources.PickUpBendDeductionTable,
                    Resources.Hint,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
                return;
            }

            if (radioButtonMethodIsKFactor.Checked && numericUpDownKFactor.Value < (decimal)0.001)
            {
                MessageBox.Show(
                    Resources.SetKFactor,
                    Resources.Hint,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
                return;
            }

            try
            {
                SaveSettings();
                DialogResult = DialogResult.OK;
                Unfold2D.ClearEvent();
            }
            catch
            {
                DialogResult = DialogResult.OK;
                // SaveSettings();
            }
        }
Beispiel #2
0
        private void buttonSelectThicknessFromSegment_Click(object sender, EventArgs e)
        {
            // Pick segment

            /*     PromptEntityOptions PolyOptions = new PromptEntityOptions("Pick segment defining thickness :");
             *   PolyOptions.SetRejectMessage("\nThis is not a generated sheet profile.\nSheet Profile is generated from a polyline with SHP command.\nCreate a sheet profile and try again.");
             *   PolyOptions.AddAllowedClass(typeof(Polyline) , true);
             *
             *   PromptEntityResult PolyResult = Application.DocumentManager.MdiActiveDocument.Editor.GetEntity(PolyOptions);
             *   if (PolyResult.Status != PromptStatus.OK)
             *   {
             *     return;
             *   }*/

            /* U2DConfig.Thickness = */
            Unfold2D.GetSheetProfileThickness(/*PolyResult.ObjectId , PolyResult.PickedPoint*/);
            // numericUpDownThickness.Value = (decimal)U2DConfig.Thickness;
            Redraw2dUnfolding();
        }
Beispiel #3
0
        private void Redraw2dUnfolding()
        {
            if (formIsInitialized && !formHasError)
            {
                U2D_PREPARE_REDRAW();

                #region Setup Unfold Config

                U2DConfig.Thickness = (double)numericUpDownThickness.Value;

                #region unfolding method
                if (radioButtonMethodIsBendDeduction.Checked && !radioButtonMethodIsKFactor.Checked)
                {
                    U2DConfig.UnfoldingMethod = Unfold2D.UnfoldingMethod.BendDeduction;
                    if (!File.Exists(textBoxBendDeductionTableFile.Text))
                    {
                        return;
                    }
                    else
                    {
                        U2DConfig.BendDeductionTableFile = textBoxBendDeductionTableFile.Text;
                    }
                }
                else
                {
                    U2DConfig.UnfoldingMethod = Unfold2D.UnfoldingMethod.KFactor;
                    if (!radioButtonKFactorUniform.Checked)
                    {
                        U2DConfig.BendDeductionTableFile = "None";
                        if (!File.Exists(textBoxKFactorTableFile.Text))
                        {
                            return;
                        }
                        else
                        {
                            // Why this is empty?
                        }
                    }
                }
                #endregion

                #region coating

                U2DConfig.DrawCoating = checkBoxDrawCoating.Checked;

                if (radioButtonCoatingLeft.Checked)
                {
                    U2DConfig.CoatingSide = SheetProfile.CoatingSide.Left;
                }
                else if (radioButtonCoatingRight.Checked)
                {
                    U2DConfig.CoatingSide = SheetProfile.CoatingSide.Right;
                }
                else if (radioButtonCoatingBoth.Checked)
                {
                    U2DConfig.CoatingSide = SheetProfile.CoatingSide.Both;
                }

                U2DConfig.CoatingLayer = comboBoxCoatingLayer.Text;

                try
                {
                    if (comboBoxCoatingColor.SelectedItem.ToString() == "ByLayer")
                    {
                        U2DConfig.CoatingColor = _drawingHelper.LayerManipulator.GetLayerColor(comboBoxCoatingLayer.Text);
                    }
                    else
                    {
                        U2DConfig.CoatingColor = (System.Drawing.Color)comboBoxCoatingColor.SelectedItem;
                    }
                }
                catch
                {
                    U2DConfig.CoatingColor = System.Drawing.Color.Yellow;
                }
                #endregion

                #region dimensions
                U2DConfig.DrawDimensions  = checkBoxDrawDimensions.Checked;
                U2DConfig.DimensionStyle  = comboBoxDimensionStyle.Text;
                U2DConfig.DimensionsLayer = comboBoxDimensionLayer.Text;
                try
                {
                    if (comboBoxDimensionColor.SelectedItem.ToString() == "ByLayer")
                    {
                        U2DConfig.DimensionsColor = _drawingHelper.LayerManipulator.GetLayerColor(comboBoxDimensionLayer.Text);
                    }
                    else
                    {
                        U2DConfig.DimensionsColor = (System.Drawing.Color)comboBoxDimensionColor.SelectedItem;
                    }
                }
                catch
                {
                    U2DConfig.DimensionsColor = System.Drawing.Color.Red;
                }
                #endregion

                #endregion

                Unfold2D.Draw2DUnfolding(U2DConfig);
                numericUpDownInternalRadius.Value = Settings.Default.U2D_InternalRadius;
            }
        }
Beispiel #4
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     Unfold2D.ClearEventA();
     Close();
 }