private void btnUpdateFrameSize_Click(object sender, EventArgs e)
        {
            Acad.Document acCurDoc = Acad.Application.DocumentManager.MdiActiveDocument;
            try
            {
                if (cmbDirection.SelectedIndex == -1 || cmbFrameSize.SelectedIndex == -1 || cmbItemType.SelectedIndex == -1)
                {
                    Acad.Application.ShowAlertDialog("类型、方向、图幅参数必须选择!");
                }

                DwgFrameTools dft = new DwgFrameTools(acCurDoc, XmlUtil.getXmlValue("markArea", "value") == "true");

                DwgInfo info = dft.DwgInformation;
                dft.ReplaceFrameBlock(dft.GenerateStandardDwgFileName(
                                          cmbItemType.SelectedIndex == 1,  //1——零件
                                          cmbDirection.SelectedIndex == 0, //0——横向
                                          cmbFrameSize.Text));
                DwgFrameTools dft2 = new DwgFrameTools(acCurDoc, XmlUtil.getXmlValue("markArea", "value") == "true");
                //info.Name += "new";
                //info.DwgNO = "new Dwg no";

                dft2.UpdateDwgInfo(info);
            }
            catch (System.Exception ex)
            {
                acCurDoc.Editor.WriteMessage(ex.ToString());
            }
        }
示例#2
0
        private void UpdateFrameSize()
        {
            //未更改则不改图框
            if (ckForceUpdateFrame.Checked == false && this.size == cmbFrameSize.Text && cmbDirection.Text == this.dft.DwgInformation.Direction && cmbItemType.Text == this.dft.DwgInformation.DwgType)
            {
                Acad.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\r\n跳过更新图框。。。\r\n");
                return;
            }
            if (cmbDirection.SelectedIndex == -1 || cmbFrameSize.SelectedIndex == -1 || cmbItemType.SelectedIndex == -1)
            {
                Acad.Application.ShowAlertDialog("类型、方向、图幅参数必须选择!");
            }

            DwgFrameTools dft = new DwgFrameTools(acCurDoc, XmlUtil.getXmlValue("markArea", "value") == "true");

            DwgInfo info = dft.DwgInformation;

            dft.ReplaceFrameBlock(dft.GenerateStandardDwgFileName(
                                      cmbItemType.SelectedIndex == 1,               //1——零件
                                      cmbDirection.SelectedItem.ToString() == "横向", //0——横向
                                      cmbFrameSize.Text));
        }
示例#3
0
 public bool IsFrameSizeEqual(DwgInfo info)
 {
     return(info.DwgType == DwgType && info.Height == Height && info.Width == Width);
 }