/// <summary>
        /// 获取门式框架结构选择的列表;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_GetListDoor_Click(object sender, EventArgs e)
        {
            if (!ValidateModule(MrModuleType.DimList))
            {
                Close();
            }
            if (!JudgeTeklaIsOpen())
            {
                return;
            }

            listView_DrawingDoor.Items.Clear();

            CDimManager.GetInstance().GetSelDrawingList();

            List <CMrAssemblyDrawing> mrAssemblyDrawingList = CDimManager.GetInstance().mrAssemblyDrawingList;

            if (mrAssemblyDrawingList == null || mrAssemblyDrawingList.Count == 0)
            {
                return;
            }

            foreach (CMrAssemblyDrawing drawing in mrAssemblyDrawingList)
            {
                string strName   = drawing.mName;
                string strMark   = drawing.mMark;
                string strTitle1 = drawing.mTitle1;
                string strTitle2 = drawing.mTitle2;
                string strTitle3 = drawing.mTitle3;

                ListViewItem listViewItem = new ListViewItem(new string[] { strMark, strName, strTitle1, strTitle2, strTitle3 });
                listViewItem.Tag = drawing;
                listView_DrawingDoor.Items.Add(listViewItem);
            }
        }
Example #2
0
 /// <summary>
 /// 获取唯一的实例;
 /// </summary>
 /// <returns></returns>
 public static CDimManager GetInstance()
 {
     if (null == mInstance)
     {
         mInstance = new CDimManager();
     }
     return(mInstance);
 }
        /// <summary>
        /// 门式框架结构列表标注;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_DimListDoor_Click(object sender, EventArgs e)
        {
            if (!JudgeTeklaIsOpen())
            {
                return;
            }

            CDimManager.GetInstance().DrawSelectListDrawingDoor();
        }
Example #4
0
 /// <summary>
 /// 初始化前视图;
 /// </summary>
 private void InitFrontView()
 {
     if (mFrontView == null)
     {
         return;
     }
     mCylinderFrontView = new CCylinderFrontView(mFrontView, CDimManager.GetInstance().GetModel());
     mCylinderFrontView.InitFrontView();
     mrPartList = mCylinderFrontView.GetMrPartList();
 }
        /// <summary>
        /// 判断tekla是否已经打开;
        /// </summary>
        /// <returns></returns>
        private bool JudgeTeklaIsOpen()
        {
            CDimManager.GetInstance().Init();

            if (!CDimManager.GetInstance().GetModel().GetConnectionStatus())
            {
                MessageBox.Show("Tekla Structures must be opened!");

                return(false);
            }
            return(true);
        }
        /// <summary>
        /// 初始化前视图;
        /// </summary>
        private void InitFrontView()
        {
            if (mFrontView == null)
            {
                return;
            }

            mBeamFrontView = new CBeamDoorFrontView(mFrontView, CDimManager.GetInstance().GetModel());
            mBeamFrontView.InitFrontView();
            mrPartList = mBeamFrontView.GetMrPartList();
            mFrontView.SetUserProperty(CCommonPara.mAutoSectionPropKey, CCommonPara.mUserPropValue);
        }
        /// <summary>
        /// 清空列表项;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ClearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (mbFrameDim)
            {
                listView_Drawing.Items.Clear();
            }
            else if (mbFrameDoorDim)
            {
                listView_DrawingDoor.Items.Clear();
            }

            CDimManager.GetInstance().mrAssemblyDrawingList.Clear();
            CDimManager.GetInstance().mDicMarkNumberToType.Clear();
        }
        /// <summary>
        /// 多张图纸选择标注;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSelectList_Click(object sender, EventArgs e)
        {
            if (!ValidateModule(MrModuleType.DimList))
            {
                Close();
            }

            if (!JudgeTeklaIsOpen())
            {
                return;
            }

            CDimManager.GetInstance().DrawSelectListDrawing();
        }
        /// <summary>
        /// 更新属性;
        /// </summary>
        private void UpdateAttribute()
        {
            CDimManager.GetInstance().Init();

            if (!CDimManager.GetInstance().GetModel().GetConnectionStatus())
            {
                return;
            }

            string strModelPath = CDimManager.GetInstance().GetModel().GetInfo().ModelPath;

            if (strModelPath == null)
            {
                return;
            }

            string strDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
            string strAttribute = Path.Combine(strDirectory, "attributes");

            CCommonPara.mMainSizeDimPath     = textBox_MainSize.Text + ".dim";
            CCommonPara.mSizeDimPath         = textBox_GeneralSize.Text + ".dim";
            CCommonPara.mAngleDimPath        = textBox_Angle.Text + ".dim";
            CCommonPara.mMainPartNotePath    = textBox_MainPart.Text + ".note";
            CCommonPara.mPartNotePath        = textBox_GeneralPart.Text + ".note";
            CCommonPara.mBoltNotePath        = textBox_Bolt.Text + ".note";
            CCommonPara.mSectionAttPath      = textBox_Section.Text + ".vi";
            CCommonPara.mSectionMarkNotePath = textBox_SectionMark.Text + ".cs";

            string strMainSize        = Path.Combine(strAttribute, CCommonPara.mMainSizeDimPath);
            string strGeneralSize     = Path.Combine(strAttribute, CCommonPara.mSizeDimPath);
            string strAngleSize       = Path.Combine(strAttribute, CCommonPara.mAngleDimPath);
            string strMainPart        = Path.Combine(strAttribute, CCommonPara.mMainPartNotePath);
            string strGeneralPart     = Path.Combine(strAttribute, CCommonPara.mPartNotePath);
            string strBoltNote        = Path.Combine(strAttribute, CCommonPara.mBoltNotePath);
            string strSectionAtt      = Path.Combine(strAttribute, CCommonPara.mSectionAttPath);
            string strSectionMarkNote = Path.Combine(strAttribute, CCommonPara.mSectionMarkNotePath);

            string strModelAttPath = Path.Combine(strModelPath, "attributes");

            File.Copy(strMainSize, Path.Combine(strModelAttPath, CCommonPara.mMainSizeDimPath), true);
            File.Copy(strGeneralSize, Path.Combine(strModelAttPath, CCommonPara.mSizeDimPath), true);
            File.Copy(strAngleSize, Path.Combine(strModelAttPath, CCommonPara.mAngleDimPath), true);
            File.Copy(strMainPart, Path.Combine(strModelAttPath, CCommonPara.mMainPartNotePath), true);
            File.Copy(strGeneralPart, Path.Combine(strModelAttPath, CCommonPara.mPartNotePath), true);
            File.Copy(strBoltNote, Path.Combine(strModelAttPath, CCommonPara.mBoltNotePath), true);
            File.Copy(strSectionAtt, Path.Combine(strModelAttPath, CCommonPara.mSectionAttPath), true);
            File.Copy(strSectionMarkNote, Path.Combine(strModelAttPath, CCommonPara.mSectionMarkNotePath), true);
        }
 /// <summary>
 /// 门式框架的剖视图标注;
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonSectionViewDoor_Click(object sender, EventArgs e)
 {
     if (!ValidateModule(MrModuleType.DimSection))
     {
         Close();
     }
     if (!JudgeTeklaIsOpen())
     {
         return;
     }
     if (mbBeamDoorDim)
     {
         CDimManager.GetInstance().CreateBeamDoorSectionView();
     }
     if (mbCylinderDoorDim)
     {
         CDimManager.GetInstance().CreateCylinderDoorSectionView();
     }
 }
        /// <summary>
        /// 顶视图标注;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnTopView_Click(object sender, EventArgs e)
        {
            if (!ValidateModule(MrModuleType.DimTOP))
            {
                Close();
            }
            if (!JudgeTeklaIsOpen())
            {
                return;
            }

            if (mbBeamDim)
            {
                CDimManager.GetInstance().CreateBeamTopViewDim();
            }
            if (mbCylindeDim)
            {
                CDimManager.GetInstance().CreateCylinderTopViewDim();
            }
        }
        /// <summary>
        /// 删除列表项;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection lvItems = null;

            if (mbFrameDim)
            {
                lvItems = listView_Drawing.SelectedItems;
            }
            else if (mbFrameDoorDim)
            {
                lvItems = listView_DrawingDoor.SelectedItems;
            }
            if (lvItems.Count == 0)
            {
                return;
            }

            for (int i = 0; i < lvItems.Count; i++)
            {
                ListViewItem lvItem = lvItems[0];

                object tag = lvItem.Tag;

                if (tag == null)
                {
                    continue;
                }

                CMrAssemblyDrawing mrDrawing = tag as CMrAssemblyDrawing;
                CDimManager.GetInstance().mrAssemblyDrawingList.Remove(mrDrawing);

                if (mbFrameDim)
                {
                    listView_Drawing.Items.Remove(lvItem);
                }
                else if (mbFrameDoorDim)
                {
                    listView_DrawingDoor.Items.Remove(lvItem);
                }
            }
        }
 /// <summary>
 /// 门式钢架的顶视图标注;
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonTopViewDoor_Click(object sender, EventArgs e)
 {
     if (!ValidateModule(MrModuleType.DimTOP))
     {
         Close();
     }
     if (!JudgeTeklaIsOpen())
     {
         return;
     }
     //门式钢架没有顶视图标注;
     if (mbBeamDoorDim)
     {
         return;
     }
     //门式框架结构中的柱标注;
     if (mbCylinderDoorDim)
     {
         CDimManager.GetInstance().CreateCylinderDoorTopView();
     }
 }
        /// <summary>
        /// 自动剖面测试;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_AutoSection_Click(object sender, EventArgs e)
        {
            if (!ValidateModule(MrModuleType.DimTOP))
            {
                Close();
            }
            if (!JudgeTeklaIsOpen())
            {
                return;
            }
            string strDimType = null;

            if (mbBeamDim == true)
            {
                strDimType = "梁标注";
            }
            if (mbCylindeDim)
            {
                strDimType = "柱标注";
            }

            CDimManager.GetInstance().CreateAutoSectionTest(strDimType, 0);
        }
        /// <summary>
        /// 门式框架结构的标注设置;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_DimSettingDoor_Click(object sender, EventArgs e)
        {
            if (!ValidateModule(MrModuleType.SetDim))
            {
                Close();
            }
            if (!JudgeTeklaIsOpen())
            {
                return;
            }

            List <CMrAssemblyDrawing> drawingList = CDimManager.GetInstance().mrAssemblyDrawingList;

            if (drawingList.Count == 0)
            {
                MessageBox.Show("请先获取图纸列表");
                return;
            }

            DimSettingForm form = new DimSettingForm();

            form.ShowDialog(this);
        }
        /// <summary>
        /// 一键快速标注;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOneKeyDim_Click(object sender, EventArgs e)
        {
            if (!ValidateModule(MrModuleType.DimTOP))
            {
                Close();
            }
            if (!JudgeTeklaIsOpen())
            {
                return;
            }
            string strDimType = null;

            if (mbBeamDim == true)
            {
                strDimType = "梁标注";
            }
            if (mbCylindeDim)
            {
                strDimType = "柱标注";
            }

            CDimManager.GetInstance().DrawDrawingOneKey(strDimType);
        }