How to Access Drawing database...

Discussion in 'AutoCAD' started by Gary J. Orr, Feb 16, 2004.

  1. Gary J. Orr

    Gary J. Orr Guest

    Without actually opening the drawing.
    My goal is this:
    Acquire a list of all paperspace layouts from a given list of drawings
    without actually opening them.

    With VBA we can use the "thisdrawing.layouts" property on an open drawing.
    Then we can step through and acquire the names with a "For Each" statement
    and the ".name" property. We can also open drawings from a list and acquire
    a list of the layouts within each drawing by using the preceding in each
    successive drawing.

    How (short of buying and learning C++ and paying a huge developers fee to
    AutoDesk and any others) can the above be done in VB or VBA without actually
    opening the drawing in the Drawing Editor?

    The reason for asking is that it can take a long time to open ADT, ABS, LDT,
    etc. drawings in AutoCAD (the current session or a hidden one in the
    background) just to perform the simple task of obtaining a list of layouts.

    AutoCAD developers do the same thing when we use the design center to drag
    layouts into a drawing or (similarly) when we are importing page setups from
    a different drawing, but I believe that they use C++ to do it.

    Any help would be greatly appreciated.


    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
     
    Gary J. Orr, Feb 16, 2004
    #1
  2. You can do it with VBA or VB
    Search for ObjectDBX in this NG and you'll find plenty of examples.
     
    Jorge Jimenez, Feb 16, 2004
    #2
  3. Gary J. Orr

    Gary J. Orr Guest

    I had searched... my ignorance of certain assumptions caused me to stumble
    early on... I did not have the correct type libraries loaded to interpret
    most of what I had been reading and trying. As such everything was failing
    for me and my frustration level was going through the roof.

    Are there specific type libraries for VBA to give access to the DBX
    functions? I currently have:
    AutoCAD/ObjectDBX Common 16.0 Type Library;
    AutoCAD/ObjectDBX Common 1.0 Type Library;

    I found the following line in one of my searches:
    AcadApplication.GetInterfaceObject("ObjectDBX.AxDbDocument")
    this reference to a type library reminded me of my training...

    Please excuse my ignorance as I'm a newbie to VB/VBA.

    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
     
    Gary J. Orr, Feb 16, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.