Results 1 to 2 of 2

Thread: Cannot embed interop type

  1. #1
    Member
    Join Date
    2004-08
    Posts
    48

    Default Cannot embed interop type

    Sorry for the duplicate post. Searching for a way to delete one of them.

    I have a VB 2010 Express Project. Using ACA 2013. i have an error that seems to be related to a file that can't be found but I can see the .dll in the location listed by the reference. Here is sample code.
    Code:
    Imports AecXBase
    Imports AecXUIArchBase
    Imports AutoCAD
    Imports AecXArchBase
    
    ..... 
    
    Function LayerFromKey(lName As String) As String
    Dim lyr As AcadLayer, lKeyStyle As AecLayerKeyStyle
    lKeyStyle = getAecBaseDB.LayerKeyStyles(getLayerStandard)
    lyr = lKeyStyle.GenerateLayer(lName)
    LayerFromKey = lyr.Name
    End Function
    
    .....
    This is the error indicated on "AecLayerKeyStyle":
    Error 1 Cannot embed interop type 'AecXBase.IAcadObjectEvents_Event' because the source interface 'AXDBLib.IAcadObjectEvents' referenced by its ComEventInterfaceAttribute cannot be found. C:\Users\mike.OPSIS\Documents\Visual Studio 2010\Projects\AutoCAD VB plug-in1\AutoCAD VB plug-in1\cLayer.vb 18 44 AutoCAD VB plug-in1
    Last edited by michael.montagne; 2012-05-22 at 09:13 PM.

  2. #2
    Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    2,385

    Default Re: Cannot embed interop type

    You've found the referenced assembly in Windows Explorer, but it (the error message) sounds as though you are missing a Reference to your solution. Perhaps adding the 'source interface' reference will resolve the error altogether?

    Separately, you might also want to consider using a Try Catch Finally block.

    HTH
    "Potential has a shelf life." - Margaret Atwood

Similar Threads

  1. ACAD COM Interop, accessing attributes
    By ramanujan_ag in forum Dot Net API
    Replies: 2
    Last Post: 2010-06-26, 05:21 AM
  2. InterOp libraries for Autosketch R7 and above
    By dean.richardson in forum Dot Net API
    Replies: 0
    Last Post: 2007-07-18, 04:01 PM
  3. Replies: 2
    Last Post: 2006-08-12, 09:28 PM
  4. R9 interop acad allow this?
    By Vincent Valentijn in forum Inventor - General
    Replies: 2
    Last Post: 2004-09-09, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •