.NET

Reply
Contributor
kerry.clouser
Posts: 20
Registered: ‎10-30-2007
Message 1 of 6 (754 Views)
Accepted Solution

Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event'

754 Views, 5 Replies
05-30-2012 02:52 PM

I am attempting to rewrite a VBA program in VB.NET for AutoCAD Mechanical 2012, 64 bit, Windows 7 using Visual Studio 2010 Pro.  The program extracts Mechanical BOM data and exports it to a formatted Excel Bill of Material.  I have the following error that I cannot resolve:

 

Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event' because the source interface 'Autodesk.AutoCAD.Interop.Common.IAcadObjectEvents' referenced by its ComEventInterfaceAttribute cannot be found.

 

There is no Line or Column referenced in the error list.  Clicking on the error does not expose the source or location of the error.  I have referenced AutoCAD 2012 Type Library, Mechanical 1.0 Type Library, GeAuto 2.0 Type Library, SymBBAuto 3.0 Type Library, and AutoCAD.Interop.Common, all as COM types, and AcDbMgd, AcMgd, and AutoCAD.Interop as .NET types.  I have declared SymBBAuto, Autodesk.AutoCAD.Interop, and Autodesk.AutoCAD.Interop.Common as Imports along with many other AutoCAD namespaces.

 

Any help would be greatly appreciated

KerryC
Distinguished Contributor
VB_Autocad_guy
Posts: 136
Registered: ‎07-24-2009
Message 2 of 6 (729 Views)

Re: Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event'

05-31-2012 09:11 AM in reply to: kerry.clouser

Can you post the code where you are using the Interop.common library? 

Otherwise... you might want to do some research of the Interop libraries and 64-bit issues. 

I know when I was trying to run a program 32-bit vs 64-bit you have to be real careful how things are setup. 

 

:smileyhappy: 

 

Cheers!

*Expert Elite*
norman.yuan
Posts: 943
Registered: ‎04-27-2009
Message 3 of 6 (726 Views)

Re: Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event'

05-31-2012 10:13 AM in reply to: kerry.clouser

Obviously, your project is targeting .NET4.0, which automatically embeds interop assembly in the project if a COM reference is set, by default.

 

However, in the most cases of setting refernces to AutoCAD (and its vertical products') COM interops, embedding COM interop assemblies does not work. That is, you DO NOT embed the interop assemblies. You need to set the "Embed.." property to "False" in conjunction of "Copy Local" also being set to "False".

 

The one interop assembly that I found have to be embedded is the Sheetset COM interop assembly (AcSmComponents17/8), when working with Acad2012(I did not try with other versio of Acad).

Valued Contributor
smccoywm
Posts: 51
Registered: ‎09-29-2008
Message 4 of 6 (725 Views)

Re: Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event'

05-31-2012 10:14 AM in reply to: kerry.clouser

Attached is some of the Code and the errors I am getting.

 

        Dim symbb As McadSymbolBBMgr
        Dim bommgr As McadBOMMgr
        Dim stdmgr As McadStandardMgr
        Dim util As Autodesk.AutoCAD.Interop.AcadUtility

        symbb = oDoc.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
        bommgr = symbb.BOMMgr
        stdmgr = symbb.StandardMgr
        util = oDoc.Utility

        Dim standard As McadStandardMgr
        standard = symbb.StandardMgr
        Dim BOMstd As McadBOMStandard
        Dim plistStd As McadPartListStandard

        standard = stdmgr.GetStandard("ANSI")
        BOMstd = standard.BOMStandard
        plistStd = BOMstd.PartListStandard

        Dim target As Autodesk.AutoCAD.Interop.Common.AcadBlock
        Dim BOM As McadBOM
        Dim name As String

        target = oDoc.ModelSpace
        If bommgr.BOMTableExists(target) Then
            BOM = bommgr.GetBOMTable(target, name)
        Else
            BOM = bommgr.AddBOMTable("WM", target)
        End If

        Dim plist As McadPartList
        plist = oDoc.PaperSpace.AddCustomObject("AcmPartList")

 Errors.JPG

Trying to Add.JPG

 

Contributor
kerry.clouser
Posts: 20
Registered: ‎10-30-2007
Message 5 of 6 (721 Views)

Re: Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event'

05-31-2012 10:30 AM in reply to: kerry.clouser

Thank you Norman,

In the project References I checked the Embed Interop Types property and it was set to True for both the SymBBAuto and GeAuto type libraries.  I set these to False and the error cleared itself.  Copy Local was already set to False.

KerryC
Contributor
kerry.clouser
Posts: 20
Registered: ‎10-30-2007
Message 6 of 6 (715 Views)

Re: Cannot embed interop type 'SymBBAuto.IAcadObjectEvents_Event'

05-31-2012 10:58 AM in reply to: smccoywm

smccoywm,

From your screen shot it is obvious that you need to add a reference to AXDBLib.  Under your References the first entry is blank with a notice that the system cannot find the reference specified.  Is it possible that there had been a reference to AXDBLib but for some reason your project lost it.  Remove the first entry.  Then re-add the required reference.

KerryC

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community