Beispiel #1
0
        public static void saveData(AssemblyDocument m_AsmDoc)
        {
            XDocument xd = new XDocument();

            InvDoc.InvDocument <AssemblyDocument> iDoc = new InvDoc.InvDocument <AssemblyDocument>(m_AsmDoc);
            iDoc.doc = (Document)m_AsmDoc;
            string name = iDoc.path + iDoc.getProp("Part Number").Value + ".xml";
            //tbl.saveDataInXML(xd,"Data",name, false);
            BOM    m_BOM         = m_AsmDoc.ComponentDefinition.BOM;
            string partNumberAsm = m_AsmDoc.PropertySets[3][2].Value.ToString();

            m_BOM.StructuredViewEnabled = true;
            // if (!m_BOM.StructuredViewFirstLevelOnly)
            // m_BOM.StructuredViewFirstLevelOnly = true;
            if (m_BOM.StructuredViewFirstLevelOnly)
            {
                m_BOM.StructuredViewFirstLevelOnly = false;
            }
            BOMView  m_BOMView = m_BOM.BOMViews["Структурированный"];
            TableInv tbl       = null;

            tbl = new TableInv(m_AsmDoc, @"C:\ProgramData\Autodesk\Inventor Addins\Sequence.xml");
            tbl.addTable(m_BOMView);
            tbl.saveDataInXML(xd, "Data", name, false);
        }
Beispiel #2
0
        private void экспортВXMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InvDoc.InvDocument <AssemblyDocument> iDoc = new InvDoc.InvDocument <AssemblyDocument>(m_AsmDoc);
            iDoc.doc = (Document)m_AsmDoc;
            string name = iDoc.path + iDoc.getProp("Part Number").Value + "(variable).xml";

            tbl.saveDataInXML(new XDocument(), "Variable", name, true, false);
        }