Results 1 to 2 of 2

Thread: Cannot embed interop type

  1. #1
    Active Member
    Join Date
    2004-08
    Posts
    50
    Login to Give a bone
    0

    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
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    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
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. CP308-4: AutoCAD VBA to .NET Migration: The Easy Way Using COM Interop
    By Autodesk University in forum Customization and Programming
    Replies: 0
    Last Post: 2014-12-01, 01:49 AM
  2. 2015: Interop.RobotOM.dll for different Robot versions
    By pedrocty2001343477 in forum Robot Structural Analysis
    Replies: 1
    Last Post: 2014-05-05, 07:32 AM
  3. ACAD COM Interop, accessing attributes
    By ramanujan_ag in forum Dot Net API
    Replies: 2
    Last Post: 2010-06-26, 05:21 AM
  4. InterOp libraries for Autosketch R7 and above
    By dean.richardson143255 in forum Dot Net API
    Replies: 0
    Last Post: 2007-07-18, 04:01 PM
  5. 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
  •