Example #1
0
        public void SetCurrentGroup()
        {
            Autodesk.AutoCAD.Colors.Color countColor = new Autodesk.AutoCAD.Colors.Color();

            Database db = HostApplicationServices.WorkingDatabase;

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                try
                {
                    PosGroup item = tr.GetObject(PosGroup.GroupId, OpenMode.ForRead) as PosGroup;
                    if (item == null)
                    {
                        return;
                    }
                    countColor = item.CountColor;
                }
                catch
                {
                    ;
                }
            }

            CountOverrule.Instance.SetProperties(countColor);

            DWGUtility.RefreshAllPos();
        }
Example #2
0
        public void CMD_HideShapes()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            ShowShapes = false;
            DWGUtility.RefreshAllPos();
        }
Example #3
0
        public void CMD_ToggleShapes()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            ShowShapes = !ShowShapes;
            DWGUtility.RefreshAllPos();
        }
        private void PosShapes()
        {
            using (PosShapesForm form = new PosShapesForm())
            {
                if (form.Init(ShowShapes))
                {
                    if (Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(null, form, false) == DialogResult.OK)
                    {
                        ShowShapes = form.ShowShapes;

                        DWGUtility.RefreshAllPos();
                    }
                }
            }
        }
Example #5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            // Apply changes
            Database db = HostApplicationServices.WorkingDatabase;

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                try
                {
                    PosGroup group = tr.GetObject(PosGroup.GroupId, OpenMode.ForWrite) as PosGroup;

                    group.DrawingUnit  = mCopy.DrawingUnit;
                    group.DisplayUnit  = mCopy.DisplayUnit;
                    group.Precision    = mCopy.Precision;
                    group.MaxBarLength = mCopy.MaxBarLength;
                    group.Bending      = mCopy.Bending;

                    group.Formula = mCopy.Formula;
                    group.FormulaVariableLength = mCopy.FormulaVariableLength;
                    group.FormulaLengthOnly     = mCopy.FormulaLengthOnly;
                    group.FormulaPosOnly        = mCopy.FormulaPosOnly;

                    group.StandardDiameters = mCopy.StandardDiameters;

                    group.TextColor                  = mCopy.TextColor;
                    group.PosColor                   = mCopy.PosColor;
                    group.CircleColor                = mCopy.CircleColor;
                    group.MultiplierColor            = mCopy.MultiplierColor;
                    group.GroupColor                 = mCopy.GroupColor;
                    group.NoteColor                  = mCopy.NoteColor;
                    group.CurrentGroupHighlightColor = mCopy.CurrentGroupHighlightColor;
                    group.CountColor                 = mCopy.CountColor;

                    group.TextStyleId = mCopy.TextStyleId;
                    group.NoteStyleId = mCopy.NoteStyleId;
                    group.NoteScale   = mCopy.NoteScale;

                    tr.Commit();
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show("Error: " + ex.Message, "RebarPos", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                }
            }

            DWGUtility.RefreshAllPos();
            Close();
        }