Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3427596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:51:23+00:00 2026-05-18T06:51:23+00:00

I have a AutoCAD 2008 plugin written in VB.NET. This plugin uses mostly the

  • 0

I have a AutoCAD 2008 plugin written in VB.NET. This plugin uses mostly the COM interface for accessing ACAD objects.

I’m currently switching from the COM interface to the managed interface and have the following question:
How can I get the matching managed ACAD object from a given COM ACAD object.

Example:
I have a AcadBlockReference object and I wan’t to have the BlockReference object which points to the same object in the drawing.
How do I get this object or maybe its ObjectID?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:51:23+00:00Added an answer on May 18, 2026 at 6:51 am

    I use the .NET library quite often to grab block references, however, I’ve never grabbed one by using a COM object. The following method is one that I’ve had that would take in a block name and location, and return the block reference. I’ve modified it here to take in a AcadBlockReference and I use it’s Name property to find it in the BlockTable. I didn’t test this as I don’t have the time to, but just thought I’d throw it out here and hope that it helps you move forward.

    Sorry that my example is in C#, but it should be easy enough to re-write in VB.NET.

    public BlockReference GetBlockReferenceFromCOM(AcadBlockReference comReference, Point3d location)
        {
            using (Database database = Application.DocumentManager.MdiActiveDocument.Database)
            {
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    BlockTable blockTable = transaction.GetObject(database.BlockTableId, OpenMode.ForRead) as BlockTable;
                    BlockTableRecord acBlkTblRecNewDoc = (BlockTableRecord)transaction.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
    
                    BlockReference newBlockReference = new BlockReference(location, blockTable[comReference.Name]);
    
                    transaction.Commit();
    
                    return newBlockReference;
                }
            }
        }
    

    EDIT
    Do you have the object id for these items? If so, you could do something like this:

    public DBObject GetBlockReferenceFromCOM(ObjectId id)
        {
            using (Database database = Application.DocumentManager.MdiActiveDocument.Database)
            {
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    return transaction.GetObject(id, OpenMode.ForRead);
                }
            }
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.