Message 1 of 1
Drawing problem with ilogic code

Not applicable
03-03-2016
06:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to create parts and make just one drawing file for all part with the below code. in the code my loop is suppressed to show you that this code even for one loop does not work...
Can anyone find the problem?
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 24575 StartFragment: 314 EndFragment: 24543 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
Sub Main() Imports Inventor.ViewOrientationTypeEnum Imports Inventor.DrawingViewStyleEnum Dim oDoc As Document = ThisDoc.Document Dim oDrawingDoc As DrawingDocument Dim xDoc As Document Dim oSheet As Sheet Dim oTG As TransientGeometry Dim oView1 As DrawingView Dim sFilePath As String = ThisDoc.Path & "\" Dim sNewName As String Dim oSaveName As String = sFilePath & ThisDoc.FileName(False) & ".idw" GoExcel.Open(ThisDoc.Path & "\" & "Nozzles.xlsx", "Sheet1") Dim kk As Double = 1 'For j = 1 To 10 GoExcel.FindRowStart = kk+1 Dim i As Double = GoExcel.FindRow(ThisDoc.Path & "\" & "Nozzles.xlsx", "Sheet1", "RadialNozzle", "=", "true","class","=",150,"flangeType","=",0) If i <> -1 Then kk = i Dim aa As Double = GoExcel.CurrentRowValue("nominalDiameter") oDoc.Save sNewName = GoExcel.CellValue("B" & i) i = GoExcel.FindRow(ThisDoc.Path & "\" & "WNFLG2.xlsx", "Sheet1", "NPS", "=", aa) Parameter("Lenght") = GoExcel.CurrentRowValue("O") RuleParametersOutput() ThisDoc.Document.Update() ThisDoc.Document.saveas(sFilePath & sNewName & ".ipt", True) xDoc = ThisApplication.Documents.Open(sFilePath & sNewName & ".ipt", False) iLogicVb.UpdateWhenDone = True ' oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject,"tt.idw",True) oDrawingDoc=ThisApplication.Documents.Open(sFilePath & "Test.idw", True) oSheet = oDrawingDoc.Sheets.Item(1) oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(5, 5) oView1 = oSheet.DrawingViews.AddBaseView(xDoc, _ oPoint1, _ 1/1#, _ kBottomViewOrientation, _ kHiddenLineDrawingViewStyle) End If 'Next j ThisApplication.ActiveView.Fit End Sub