public MyBalloon(Inventor.Document oDoc)
        {
            if (oDoc.DocumentType == DocumentTypeEnum.kDrawingDocumentObject && InvDoc.u.referendedDoc(oDoc).DocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
            {
                m_DrwDoc  = (Inventor.DrawingDocument)oDoc;
                m_AsmDoc  = (Inventor.AssemblyDocument)InvDoc.u.referendedDoc(oDoc);
                invApp    = (Inventor.Application)oDoc.Parent;
                cmdMgr    = invApp.CommandManager;
                interEvts = cmdMgr.CreateInteractionEvents();
                selEvts   = interEvts.SelectEvents;
                selEvts.AddSelectionFilter(SelectionFilterEnum.kDrawingCurveSegmentFilter);
                selEvts.SingleSelectEnabled = true;
                selEvts.OnSelect           += new SelectEventsSink_OnSelectEventHandler(selectEvts);
                mouseEvts = interEvts.MouseEvents;
                mouseEvts.MouseMoveEnabled = true;
                mouseEvts.OnMouseClick    += new MouseEventsSink_OnMouseClickEventHandler(mouseClick);
                mouseEvts.OnMouseMove     += new MouseEventsSink_OnMouseMoveEventHandler(mouseMove);
                objs = invApp.TransientObjects.CreateObjectCollection();

                interEvts.StatusBarText = "Первая точка выноски:";
                interEvts.Start();
                //dcs = (Inventor.DrawingCurveSegment)cmdMgr.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Выберите компонент:");

                //m_Type = obj.GetType();
                //compOcc = (ComponentOccurrence)m_Type.GetProperty("ContainingOccurrence");

                //interEvts.InteractionGraphics;
                //if (obj.
                //    dcs.Parent.ModelGeometry.GetType() == Inventor.ObjectTypeEnum.kEdgeProxyObject)
                //{

                //}
            }
        }
 public Utility(Document newDoc)
 {
     m_doc = newDoc;
     if (m_doc.DocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
     {
         m_Asm = (AssemblyDocument)m_doc;
     }
     if (m_doc.DocumentType == DocumentTypeEnum.kDrawingDocumentObject)
     {
         m_Drw = (DrawingDocument)m_doc;
     }
 }
        public BreakOp(Inventor.Document oDoc, bool hor)
        {
            if (oDoc.DocumentType == DocumentTypeEnum.kDrawingDocumentObject)
            {
                invApp    = (Inventor.Application)oDoc.Parent;
                m_TG      = invApp.TransientGeometry;
                cmdMgr    = invApp.CommandManager;
                m_DrwDoc  = (Inventor.DrawingDocument)oDoc;
                horizont  = hor;
                m_View    = (DrawingView)cmdMgr.Pick(SelectionFilterEnum.kDrawingViewFilter, "Вид для разрыва:");
                interEvts = cmdMgr.CreateInteractionEvents();
                //interEvts.InteractionDisabled = false;
                mouseEvts = interEvts.MouseEvents;
                mouseEvts.OnMouseClick += new MouseEventsSink_OnMouseClickEventHandler(mouseClick);
                interEvts.StatusBarText = "Первая точка разрыва:";

                interEvts.Start();

                //m_DrwDoc.ActiveSheet.DrawingViews
                //if  ( m_DrwDoc.SelectSet[1] )
                //pt1 = m_DrwDoc.SelectSet[1];
            }
        }
Beispiel #4
0
 ///<summary>Initializes a new instance of <see cref="PdfExporter"/></summary>
 public PdfExporter(Inventor.DrawingDocument Document)
 {
     this.Document = (Document)Document;
 }
 public Utility(DrawingDocument newDoc)
 {
     m_Drw = newDoc;
 }
Beispiel #6
0
        public Table(Inventor.Document pDoc, Inventor.Application m_InvApp)
        {
            boundsScreen = Screen.PrimaryScreen.WorkingArea;
            scale        = boundsScreen.Width * 0.465 / 16.5;
            m_TG         = m_InvApp.TransientGeometry;
            switch (pDoc.DocumentType)
            {
            case DocumentTypeEnum.kAssemblyDocumentObject:
                m_AsmDoc = (AssemblyDocument)pDoc;
                break;

            case DocumentTypeEnum.kDrawingDocumentObject:
                m_DrwDoc = (DrawingDocument)pDoc;
                m_AsmDoc = (AssemblyDocument)InvDoc.u.referendedDoc(m_DrwDoc as Document);    //m_DrwDoc.ReferencedDocuments.Count];
                if (m_AsmDoc.FullDocumentName.EndsWith(">"))
                {
                    m_AsmDoc = (AssemblyDocument)((Inventor.Application)m_AsmDoc.Parent).Documents.Open(m_AsmDoc.FullFileName, false);
                }
                break;
            }
            path          = pDoc.FullFileName.ToString();
            path          = path.Substring(0, path.LastIndexOf('\\'));
            m_BOM         = m_AsmDoc.ComponentDefinition.BOM;
            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;
            m_BOMView = m_BOM.BOMViews["Структурированный"];
            InitializeComponent();
            this.ClientSize        = Screen.PrimaryScreen.WorkingArea.Size;
            this.Format.Width      = (int)(0.6 * scale);
            this.Zone.Width        = (int)(0.6 * scale);
            this.Position.Width    = (int)(0.8 * scale);
            this.PartNumber.Width  = (int)(5 * scale);
            this.Description.Width = (int)(6.3 * scale);
            this.Count.Width       = (int)(1 * scale);
            this.Note.Width        = (int)(2.2 * scale);

            this.FormatVar.Width      = this.Format.Width;
            this.ZoneVar.Width        = this.Zone.Width;
            this.PositionVar.Width    = this.Position.Width;
            this.PartNumberVar.Width  = this.PartNumber.Width;
            this.DescriptionVar.Width = this.Description.Width;
            this.CountVar.Width       = this.Count.Width;
            this.NoteVar.Width        = this.Note.Width;

            int offset = (int)(0.004 * boundsScreen.Width);
            int width  = dgv.Columns.OfType <DataGridViewColumn>().Sum(e => e.Width);

            width                   += 22;
            this.dgv.Size            = new System.Drawing.Size(width, this.Size.Height - menu.Height - 50 /*(int)(boundsScreen.Height*0.08)*/);
            this.dgv.Location        = new System.Drawing.Point(0, this.menu.Bounds.Bottom);
            this.dgvVar.Size         = dgv.Size;
            this.dgvVar.Location     = new System.Drawing.Point(dgv.Location.X + dgv.Width, dgv.Location.Y);
            this.dgv.RowHeadersWidth = this.dgvVar.RowHeadersWidth = 20;

            label1.Location = new System.Drawing.Point(dgv.Location.X + width / 2 - label1.Width / 2, dgv.Location.Y /*- label1.Width/2*/ - 24);
            label2.Location = new System.Drawing.Point(dgv.Location.X + width + width / 2 - label2.Width / 2, dgv.Location.Y /*- label2.Width/2*/ - 24);
            label2.Visible  = false;
            dgvVar.Visible  = false;

            width *= 2;
            width += (int)(0.001 * boundsScreen.Width);
            int bottomButton = dgv.Bounds.Bottom + (boundsScreen.Height - dgv.Bounds.Bottom) / 2 - button1.Bounds.Height / 2;

            this.button1.Width    = button2.Width = button3.Width = txtBox.Width = /*txtBox3.Width = */ (int)(0.045 * boundsScreen.Width);
            this.button1.Location = new System.Drawing.Point(dgvVar.Bounds.Right + offset, this.menu.Bounds.Bottom + offset);
            this.button3.Location = new System.Drawing.Point(button1.Bounds.Left, button1.Bounds.Bottom + offset);
            this.button2.Location = new System.Drawing.Point(button3.Bounds.Left, button3.Bounds.Bottom + offset);
            this.lbl.Location     = new System.Drawing.Point(button2.Bounds.Left, button2.Bounds.Bottom + offset);
            this.txtBox.Location  = new System.Drawing.Point(button2.Bounds.Left, lbl.Bounds.Bottom + offset);
            //this.lbl3.Location = new System.Drawing.Point(button2.Bounds.Left, txtBox.Bounds.Bottom + offset);
            //this.txtBox3.Location = new System.Drawing.Point(button2.Bounds.Left, lbl3.Bounds.Bottom + offset);

            //initSpec(dgv);

            tbl = tbl ?? new TableInv(m_DrwDoc, @"C:\ProgramData\Autodesk\Inventor Addins\Sequence.xml");
            //if (txtBox.Text != "") tbl.split = txtBox.Text;
            //VariableDataForSpec vd = new VariableDataForSpec((Document)m_AsmDoc);
            //List<string> lst = vd.AttribLoad("Split");
            AttributeSet attSet;

            if (m_AsmDoc.AttributeSets.get_NameIsUsed("Split"))
            {
                attSet = m_AsmDoc.AttributeSets["Split"];

                if (attSet.Count != 0)
                {
                    txtBox.Text = attSet[1].Value.ToString();
                }
            }

            tbl.addTable(m_BOMView);
            if (tbl.countPerf == 0)
            {
                tbl.showTable(dgv, 0, 100, tbl.group, varData: false);
            }
            else
            {
                tbl.showTable(dgv, 0, 100, tbl.group, varData: false);
                tbl.showTable(dgvVar, 100, 5000, tbl.group, varData: true);
                dgvVar.Visible = true;
            }
            //tbl.asmDoc = m_AsmDoc;
            balloon();
            dgv.RowHeaderMouseClick += dataGridView1_RowHeaderMouseClick;
            dgv.KeyDown             += dgv_KeyDown;
        }