Exemple #1
0
        public bool Init()
        {
            Database db = HostApplicationServices.WorkingDatabase;

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

                    if (group == null)
                    {
                        return(false);
                    }

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

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

                    mCopy.StandardDiameters = group.StandardDiameters;

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

                    mCopy.TextStyleId = group.TextStyleId;
                    mCopy.NoteStyleId = group.NoteStyleId;
                    mCopy.NoteScale   = group.NoteScale;
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show("Error: " + ex.Message, "RebarPos", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return(false);
                }
            }

            mTextStyles = DWGUtility.GetTextStyles();
            foreach (string name in mTextStyles.Keys)
            {
                cbTextStyle.Items.Add(name);
                cbNoteStyle.Items.Add(name);
            }

            SetGroup();

            return(true);
        }
Exemple #2
0
        public bool Init()
        {
            m_Styles = BOQStyle.GetAllBOQStyles();

            if (m_Styles.Count == 0)
            {
                return(false);
            }

            foreach (string item in m_Styles)
            {
                TableStyleCopy copy  = new TableStyleCopy();
                BOQStyle       style = BOQStyle.GetBOQStyle(item);

                copy.Name = item;

                copy.IsBuiltin = style.IsBuiltIn;

                copy.Columns = style.Columns;

                copy.PosColumn          = style.PosLabel;
                copy.CountColumn        = style.CountLabel;
                copy.DiameterColumn     = style.DiameterLabel;
                copy.LengthColumn       = style.LengthLabel;
                copy.ShapeColumn        = style.ShapeLabel;
                copy.TotalLengthColumn  = style.TotalLengthLabel;
                copy.DiameterListColumn = style.DiameterListLabel;

                copy.TotalLengthRow = style.DiameterLengthLabel;
                copy.UnitWeightRow  = style.UnitWeightLabel;
                copy.WeightRow      = style.WeightLabel;
                copy.GrossWeightRow = style.GrossWeightLabel;

                copy.MultiplierHeadingLabel = style.MultiplierHeadingLabel;

                copy.TextStyleId    = style.TextStyleId;
                copy.HeadingStyleId = style.HeadingStyleId;
                copy.FootingStyleId = style.FootingStyleId;

                m_Copies.Add(copy);
            }

            m_TextStyles = DWGUtility.GetTextStyles();
            foreach (string name in m_TextStyles.Keys)
            {
                cbTextStyle.Items.Add(name);
                cbHeadingStyle.Items.Add(name);
                cbFootingStyle.Items.Add(name);
            }

            PopulateList();

            return(true);
        }