New Member
Posts: 2
Registered: ‎08-06-2014
Message 1 of 2 (69 Views)

Possible Missing Reference for VBA to VB.Net code????? Help

69 Views, 1 Replies
08-08-2014 05:37 AM

I keep getting the error listed below when I try to compile this code in Visual Studio Express as a VB.Net application.  I'm no coder but was trying to use some VBA code I found and transfer it over to VB.Net.  Anyone have an idea as to what I'm missing?


Error 1 Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event' because the source interface 'Autodesk.AutoCAD.Interop.Common.IAcadObjectEvents' referenced by its ComEventInterfaceAttribute cannot be found. C:\Users\cgmcneil\documents\visual studio 2012\Projects\BOM Project\BOM Project\Class1.vb 40 23 BOM Project




Imports System
Imports System.Runtime.InteropServices

Imports Autodesk.AutoCAD.Runtime
Imports Microsoft.VisualBasic.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices

Imports Autodesk.AutoCAD.Interop.Common
Imports Autodesk.AutoCAD.Interop
Imports SymBBAuto


Public Class Class1

   <CommandMethod("GetColumnsPartRef")> _
   Public Sub GetColumnsPartRef()


          Dim acadapp As Autodesk.AutoCAD.Interop.AcadApplication

          acadapp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication


          Dim acadDoc As AcadDocument = acadapp.ActiveDocument


          Dim symbb As McadSymbolBBMgr
          symbb = acadapp.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")


          'Get BOM manager
          Dim gBomMgr As IMcadBOMMgr
          gBomMgr = symbb.BOMMgr


           'Get standard manager
          Dim stdMgr As McadStandardMgr
          stdMgr = symbb.StandardMgr


          'Get the current standard
          Dim currentStd As McadStandard
          currentStd = stdMgr.CurrentStandard


          'Get BOM Standard
          Dim BOMStd As McadBOMStandard
          BOMStd = currentStd.BOMStandard


          'Get all BOM visible columns from BOM standard
          Dim BOMcol As McadColumnDefinitions
          BOMcol = BOMStd.Columns


          For i As Integer = 0 To BOMStd.Columns.Count - 1
                MsgBox(i + 1 & ". COLUMN NAME -> " & BOMStd.Columns.Item(i).Name & vbLf & _
                              i + 1 & ". COLUMN CAPTION -> " & BOMStd.Columns.Item(i).Caption)


     End Sub

End Class

*Expert Elite*
Posts: 4,426
Registered: ‎07-22-2003
Message 2 of 2 (44 Views)

Re: Possible Missing Reference for VBA to VB.Net code????? Help

08-11-2014 03:39 PM in reply to: gr8ysun
Not sure, but try setting Embed Interop Types to false in the SymBBAuto reference properties.
Jeff_M, also a frequent Swamper
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.