Inventor ilogic - programatically add parts list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi im trying to programatically add a parts list into a drawing whilst programatically creating the drawing - the code works fine without the parts list code. The error its showing is 'Parameter incorect' on the line that sais PartsList.add(... In the past when ive got this error with other code it has been because ive used an incorrect parameter (e.g. decimal instead of an integer). My error is somewhere inside the oPartsList.add(>>ERROR SOMEWHERE HERE<<<) Please Help!
oDrawDoc = InvApp.Documents.Add(Inventor.DocumentTypeEnum.kDrawingDocumentObject,AssyTemplate, True)
oSheet = oDrawDoc.Sheets.Item(1)
Dim oPoint1 = InvApp.TransientGeometry.CreatePoint2d(12, 14)
Dim oPoint2 = InvApp.TransientGeometry.CreatePoint2d(12, 32)
Dim oPoint3 = InvApp.TransientGeometry.CreatePoint2d(35, 14)
Dim oPoint4 = InvApp.TransientGeometry.CreatePoint2d(50, 32)
Dim oPoint5 = InvApp.TransientGeometry.CreatePoint2d(10, 10)
oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, ViewScale, Inventor.ViewOrientationTypeEnum.kFrontViewOrientation, Inventor.DrawingViewStyleEnum.kShadedDrawingViewStyle, "Default")
oView2 = oSheet.DrawingViews.AddProjectedView(oBaseView, oPoint2, Inventor.DrawingViewStyleEnum.kShadedDrawingViewStyle, ViewScale)
oView3 = oSheet.DrawingViews.AddProjectedView(oBaseView, oPoint3, Inventor.DrawingViewStyleEnum.kShadedDrawingViewStyle, ViewScale)
oView4 = oSheet.DrawingViews.AddProjectedView(oBaseView, oPoint4, Inventor.DrawingViewStyleEnum.kShadedDrawingViewStyle, IsoScale)
Dim oPartsList1 As PartsList
oDrawDoc.Sheets(1).PartsLists.Add(oDrawDoc, oPoint5, PartsListLevelEnum.kPartsOnly, NumberingSchemeEnum.kNumericNumbering, 1, True)
'ERROR SOMEWHERE ON THE LINE ABOVE ^^^
oPartsList1 = oDrawDoc.oSheet.PartsLists.Item(1)
oPartsList1.Sort("VENDOR", 1, "PART NUMBER", 1)
oPartsList1.Renumber()
Thanks in advance, Craig