public void setColor(int index)
        {
            var          cd = new Autodesk.AutoCAD.Windows.ColorDialog();
            DialogResult dr = cd.ShowDialog();

            if (dr == DialogResult.OK)
            {
                NewLayerFilterList[index].Color = cd.Color;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 색깔을 선택하는 창을 띄워 사용자가 선택한 색을 가져옵니다.
        /// </summary>
        /// <param name="ShowByLayerByBlock">ByLayer, ByBlock에 대한 선택이 유효한지를 결정합니다.</param>
        /// <returns>Autodesk.AutoCAD.Colors.Color가 리턴됩니다.</returns>
        public static AcColor.Color GetColorByDialog(bool ShowByLayerByBlock = true)
        {
            AcWindow.ColorDialog dlgColor = new AcWindow.ColorDialog();
            dlgColor.IncludeByBlockByLayer = ShowByLayerByBlock;

            if (dlgColor.ShowDialog() == DialogResult.OK)
            {
                return(dlgColor.Color);
            }

            return(null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Opens an AutoCAD color dialog box to let the user choose a color for the currently selected layer
        /// </summary>
        private void SelectColor()
        {
            Autodesk.AutoCAD.Windows.ColorDialog dlg = new Autodesk.AutoCAD.Windows.ColorDialog();

            // if Cancel is clicked instead of OK
            if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                // set selected color to White
                dlg.Color = Autodesk.AutoCAD.Colors.Color.FromRgb(255, 255, 255);
            }

            // set color in selected Layer in layerList
            ////         layerList[the selected layer name]                    (  Red value of the selected color,     Green value of selected color, Blue value of selected color     )
            this.layerList[this.layersListBox.SelectedItem.ToString()].SetColor(dlg.Color.ColorValue.R.ToString(), dlg.Color.ColorValue.G.ToString(), dlg.Color.ColorValue.B.ToString());
        }
Ejemplo n.º 4
0
 private void Colorbtn_Click(object sender, EventArgs e)
 {
     acadWin.ColorDialog cdlg = new acadWin.ColorDialog();
     cdlg.ShowDialog();
     //Colorbtn.BackColor = cdlg.Color;
 }