Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
401 Views, 2 Replies

Error by placing partlist on drawing

Hi,

 

i sometimes get the following error by placing a partlist on a inventor DWG

 

"Object of type 'System.UInt32' cannot be converted to type 'Inventor.CommandTypesEnum"

 

Why is that?

 

I use this VB.NET code:

Dim oDrawDoc As Inventor.DrawingDocument
oDrawDoc = m_inventorApplication.ActiveDocument

Dim oSheet As Inventor.Sheet
oSheet = oDrawDoc.ActiveSheet

Dim oDrawingView As Inventor.DrawingView
oDrawingView = oSheet.DrawingViews.Item(1)

Dim oRefDoc As Inventor.AssemblyDocument
oRefDoc = oDrawingView.ReferencedFile.ReferencedDocument

Dim oBOM As Inventor.BOM
oBOM = oRefDoc.ComponentDefinition.BOM
oBOM.StructuredViewEnabled = True
                    
Dim oBOMView As Inventor.BOMView
oBOMView = oBOM.BOMViews.Item("Structured")

Dim oPoint2D As Inventor.Point2d
oPoint2D = m_inventorApplication.TransientGeometry.CreatePoint2d(66,0) 

Dim oPartList As Inventor.PartsList
oPartList = oSheet.PartsLists.Add(oDrawingView, oPoint2D, Inventor.PartsListLevelEnum.kStructured, Nothing, 1, False) 


 

Geert