Ejemplo n.º 1
0
        private void balloon()
        {
            string partNumber, desc, note;

            dic = dic ?? new Dictionary <string, string>();
            dic.Clear();
            foreach (Balloon ball in m_DrwDoc.ActiveSheet.Balloons)
            {
                foreach (BalloonValueSet item in ball.BalloonValueSets)
                {
                    BOMRow row = item.ReferencedRow.BOMRow;
                    dic        = tbl.propDoc(row);
                    partNumber = dic["PartNumber"]; desc = dic["desc"]; note = dic["note"];
                    TableRow tr = tbl.rows.Find(r => r.cells[3].value == partNumber && r.cells[4].value == desc);

                    if (tr != null)
                    {
                        if (tr.group < 100)
                        {
                            dgv[0, tr.dvgRow].Style.BackColor = System.Drawing.Color.Green;
                        }
                        else
                        {
                            dgvVar[0, tr.dvgRow].Style.BackColor = System.Drawing.Color.Green;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void загрузитьДанныеToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            DataGridViewRow dgvr;

            InvDoc.InvDocument <AssemblyDocument> iDoc = new InvDoc.InvDocument <AssemblyDocument>(m_AsmDoc);
            iDoc.doc = (Document)m_AsmDoc;
            dgvr     = dgvVar.CurrentRow;
            TableRow tr = tbl.rows.OfType <TableRow>().FirstOrDefault(t => t.group > 100 && t.dvgRow == dgvr.Index);

            if (tr == null)
            {
                return;
            }
            //OpenFileDialog ofd = new OpenFileDialog();
            //ofd.InitialDirectory = iDoc.path;
            //ofd.Filter = "(*.iam, *.ipt)|*.iam;*.ipt";
            //ofd.ShowDialog();
            string fileName = InvDoc.u.OFD(iDoc.path, "(*.iam, *.ipt)|*.iam;*.ipt");
            //string fileName = ofd.FileName;
            Document doc = Macros.StandardAddInServer.m_inventorApplication.Documents.Open(fileName, false);
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic = TableInv.propDoc(doc);
            try
            {
                tr.cells[3].value  = dic["PartNumber"];
                tr.cells[4].value  = dic["desc"];
                tr.cells[6].value  = dic["note"];
                tr.cells[7].value  = dic["dxf"];
                tr.cells[8].value  = dic["thickness"];
                tr.cells[9].value  = dic["FPLength"];
                tr.cells[10].value = dic["FPWidth"];
            }
            catch (Exception)
            {
            }
            doc.Close();
            tbl.showTable(dgvVar, 100, 5000, tbl.group, varData: true);
            //tbl.addVarRows(dgvr.Cells[3].Value.ToString(), dgvr.Cells[4].Value.ToString(), tbl.countPerf);
            //dgv.Rows.Remove(dgvr);
            //tbl.showTable(dgv, 0, 99, tbl.group, varData: false);
            //tbl.showTable(dgvVar, 100, 5000, tbl.groupVar, varData: true);
            //balloon();
        }