Message 1 of 13
drawing automatic

Not applicable
02-29-2016
12:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have three parts a1.ipt, a2.ipt and a3.ipt
Now i want to have automatic drawing of these part in one drawing for one view (for example front view)
it's my code but it give me error
Imports Inventor.ViewOrientationTypeEnum Imports Inventor.DrawingViewStyleEnum GoExcel.Open("C:\Users\a.khakbaz\Desktop\nozzle\ali.xlsx", "Sheet1") Dim oDrawingDoc as DrawingDocument Dim oPartDoc as Document Dim oSheet As sheet Dim oTG As TransientGeometry Dim oView1 as DrawingView Dim sFilePath As String= ThisDoc.Path & "\" For i=2 To 4 dwgQuery=MsgBox("Would you like to Create a drawing for this Nozzle&Flange?", vbYesNo,"Drawing Selection") sNewName=GoExcel.CellValue("A" & i) If dwgQuery = vbYes Then ' oPartDoc = ThisDoc.Document xDoc = ThisApplication.Documents.Open(sFilePath & sNewName & ".ipt") oDrawingDoc = ThisApplication.documents.Add(kDrawingDocumentObject, _ "test.idw", True) oSheet = oDrawingDoc.Sheets.Item(1) oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(5#, 5#) oView1 = oSheet.DrawingViews.AddBaseView(xDoc, _ oPoint1, _ 1/1#, _ kBottomViewOrientation, _ kHiddenLineDrawingViewStyle) ' Dim oApp As Application oApp = ThisApplication Dim oActiveSheet As Sheet oActiveSheet = oApp.ActiveDocument.ActiveSheet oView1 = oActiveSheet.DrawingViews.Item(1) 'rotate by 45 degrees (converted from Radians) 'True = Clockwise oView1.RotateByAngle(90*(PI / 180), False) oDrawingDoc.saveas(sFilePath & sNewName & ".idw",False) End If Next i
i write this code in part file which is name cube.ipt in second rule named drawing i want to get drawing in one file.
i send you my files in zip file.
inventor 2016