Parsing ACADDatabase

Discussion in 'AutoCAD' started by Rob Tanner, Mar 30, 2007.

  1. Rob Tanner

    Rob Tanner Guest

    Is it possible to look through a drawing file's database in VBA, without
    loading it and generating the model. I'm trying to parse information out of
    a whack of files and loading all the graphics takes time and is unnecessary.

    Regards,
    Rob
     
    Rob Tanner, Mar 30, 2007
    #1
  2. Rob Tanner

    Joe Guest

    I don't have a specific program to refer you to, but I would recomend
    serching for a translator program that can accept a DWG and export a
    DXF. Then, I would use the VBA on the DXF version. You may be able
    to control the translation software through VBA as well.

    Joe Dunfee
     
    Joe, Apr 2, 2007
    #2
  3. Hi Rob,
    Typically developers use a library that allows loading the DWG file
    into a 'database'. Then your code can query the database and retrieve
    the required information. We at CAD & Company (in the Netherlands)
    started to use the official RealDWG library by AutoDesk, available
    only to selected developers for a yearly fee. Other libraries are
    available, but I believe none are free.

    An other option to get data from a specific file is to use an IFilter.
    Actually IFilters are developed to be used by search indexers such as
    Windows Desktop Search or SharePoint, but anyone can use the ifilter
    in custom code. The IFilter serves as a translater and would read the
    textual contents from the file for you, and you can then
    programmatically extract the text from the IFIlter.

    We are developing a new version of our DWG IFilter. The new version is
    able to read files up to AutoCAD 2007 and 2008 - and is expected to be
    released in a couple of weeks. A free trial will be available, also it
    is free for non-commercial desktop use. For now, you can start testing
    with our 2005 trial DWG IFilter, available at www.cadcompany.nl/ifilter

    I have not seen VBA samples to use the IFilter in such a way, I would
    be interested in helping you here - especially when this results in
    cool code samples I can publisch on my IFilter support site. Some
    samples in C# and VB are available. I believe you may be able to use
    the code sample from the next article:
    http://www.codeproject.com/csharp/DesktopSearch1.asp?df=100&forumid=190772&exp=0&select=1661650
    additionally, the article seems to point to more code samples.

    So, if the information you need is text-based, you can use our IFilter
    and go with the IFilter trick. You can try this for free.
    Alternatively you would need to purchase a dwg reading library.
    Good luck, and please keep us posted!
     
    Marco van Schagen, Apr 3, 2007
    #3
  4. Rob Tanner

    Rob Tanner Guest

    Thanks for all the responses. I'm going to try using ObjectDBX. I've just
    started but initial tests are promising. It opens the file without
    rendering the model.
    I may give that a try as well. Thanks for the pointer.
    Noted, if I head in that direction I'll keep you in mind. I've been
    side-tracked with other things for the next while, but I know where to find
    you now.

    Cheers,
    Rob
     
    Rob Tanner, Apr 16, 2007
    #4
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.