VB6 - Extract attributes

Discussion in 'AutoCAD' started by m0nz0, Nov 9, 2004.

  1. m0nz0

    m0nz0 Guest

    I'm making a project in VB6 and i don't know what i need to import data from acad¿?

    can somebody help me?

    thanks in advance
     
    m0nz0, Nov 9, 2004
    #1
  2. You can work with the drawing attributes directly from VB6 code.
    1. Get your AutoCAD Application object using VB functions CreateObject() or
    GetObject().
    2. Set your ACAD ActiveDocument object.
    3. Build a selection set of drawing objects (usually block references) that
    contain the attributes you want.
    4. Step through the objects in the selection set with a For Each loop.
    Check to make sure the object has attributes using it's HasAttributes
    method. If so, gather the attributes into an array using the object's
    GetAttributes method.
    5. Step through the array to read the attribute's TagString property (it's
    name) and TextString property (it's value). Update the TextString as
    necessary, or store them to a database, or whatever.
    6. Do your cleanup and release your objects.

    That's the sketch. Details and examples are in the help files. Ask more
    questions when you are ready.
     
    John Goodfellow, Nov 9, 2004
    #2
  3. m0nz0

    m0nz0 Guest

    hello,

    in the second step you wrote "ACAD active document Object"

    i would try to do without open the AutoCAD only selecting a DWG , is this possible?

    thanks
    jordi m
     
    m0nz0, Nov 9, 2004
    #3
  4. m0nz0

    SpeedCAD Guest

    Hi...

    Yes, It is possible with ObjectDBX, But yo don't to work with SelectionSet.

    Un saludo de SpeedCAD... :D
    CHILE
    FORO: http://www.hispacad.com/foro
     
    SpeedCAD, Nov 9, 2004
    #4
  5. Browse through this site:
    http://www.opendwg.org/

    And run the terms "OpenDWG" and "Open Design Alliance" through your favorite
    search engine. You may find what you are looking for.
     
    John Goodfellow, Nov 9, 2004
    #5
  6. m0nz0

    misteffhh Guest

    Please post how it went m0nz0, your post read my mind. i'm in the same boat and it would be nice to know if its even worth getting into?
     
    misteffhh, Nov 10, 2004
    #6
  7. I am confused John I did not find any such code examples?
     
    disscussion.autodesk.com, Nov 10, 2004
    #7
  8. Did I say you would find sample code? Open Design Alliance produces
    libraries and utilities that can be used to read/write .DWG files without
    the presence of AutoCAD. There would probably be sample code in their kits,
    but you will need to explore that yourself. If you have AutoCAD installed
    on your target machines, but just don't want to open it in order to read the
    attributes, then look into the ObjectDBX, which is supplied by Autodesk.
     
    John Goodfellow, Nov 10, 2004
    #8
  9. m0nz0

    misteffhh Guest

    Extracting from a DXF with VB is pretty easy if you can use dxfs instead of dwgs.
     
    misteffhh, Nov 10, 2004
    #9
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.