02-14-2017
03:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-14-2017
03:33 AM
Hmm, that's strange. When it throws the error again, click on the second error tab. You can read there some more info about the error.
Also, you can shorten your code like this (orange is what I've changed):
Dim oDrawDoc As Inventor.DrawingDocument = m_inventorApplication.ActiveDocument Dim oSheet As Inventor.Sheet = oDrawDoc.ActiveSheet
If oSheet.DrawingViews.Count = 0 Then Exit For Dim oDrawingView As Inventor.DrawingView = oSheet.DrawingViews.Item(1) Dim oRefDoc As Inventor.AssemblyDocument = oDrawingView.ReferencedFile.ReferencedDocument Dim oBOM As Inventor.BOM = oRefDoc.ComponentDefinition.BOM oBOM.StructuredViewEnabled = True Dim oBOMView As Inventor.BOMView = oBOM.BOMViews.Item("Structured") Dim oPoint2D As Inventor.Point2d = m_inventorApplication.TransientGeometry.CreatePoint2d(66, 0)
Dim oLevel As Inventor.PartsListLevelEnum = Inventor.PartsListLevelEnum.kStructured
Dim oPartList As Inventor.PartsList = oSheet.PartsLists.Add(oDrawingView, oPoint2D, oLevel, Nothing, 1, False)
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods