ObjectArx : where to start from ?

Discussion in 'AutoCAD' started by david, Nov 18, 2004.

  1. david

    david Guest

    I am completely new to AutoCad and I was asked by my boss to explore
    ObjectArx + C++ programming (he gave me a 15 days deadline) to see if
    that was a viable way to draw some 2D graphics on the AutoCad window,
    out of data stored in Excel format, possibly CSV. (Sorry if I didn't
    use the proper terms, but I'm a AC newbie)

    Of course I'm not new to C++, writing the math engine to process data
    is not a problem. On the contrary I don't know how to draw graphics
    primitive on a AutoCad window, so I began browsing some of the example
    and help files shipped with AutoDesk MAp 3D (ObjectArxLabs.chm,
    arxdev.chm and arxdoc.chm), coding the provided examples, but I soon
    got lost.

    I mean there's too much, too many details, while I just need to get an
    overview of what ObjectArx is, and can do.

    I don't need at all to master the AutoCad thing, I can't, I haven't
    the time, and that's completely different from my programming
    experience and attitude.

    The final customer just asked to have these 2D graphics drawn on a
    given window; what s/he will do then with that, it's not my own
    business.

    So can someone please help me and tell me where to look in the help
    and examples files, to be on a fast(er) track, or where on the
    InterNet can I find a FREE ObjectArx tutorial/primer which doesn't
    require to master the whole AutoCad + ObjectArx thing, before being
    able to understand how to do some basics ObjectArx programming ?

    Thanks,

    David

    PS: I know that you can do some programming in AutoCad via VBA macros,
    but that option has already been considered and rejected.
     
    david, Nov 18, 2004
    #1
  2. 15 days, eh? To get a handle on two knowledge domains? A bit of a tight
    timeline, isn't it?
    Here are a couple of resources to check out:

    Autodesk ObjectARX discussion forum:
    news://discussion.autodesk.com/autodesk.autocad.objectarx

    Autodesk Developer Center, ObjectARX SDK download:
    http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=785550
    If you don't have time to learn AutoCAD, and it's different from your
    programming experience and attitude, then Object ARX programming
    is NOT the route you need to take. You really need to know AutoCAD
    before you go hacking into the guts of AutoCAD with ObjectARX.
    Most ObjectARX developers worked with AutoCAD for years
    before ever writing a single line of ObjectARX C++ code.
    Out of curiosity, why was it rejected? It seems to me that using the VBA
    approach
    to read XLS or CSV data to create 2D graphics would be about the fastest,
    easiest approach to the problem. But regardless of whether you choose VBA
    macros,
    or AutoLisp routines, or ObjectARX modules, you have to know how AutoCAD
    works.

    Just my $0.02...


    -Rick
     
    Rick Francken, Nov 19, 2004
    #2
  3. david

    HenrikV Guest

    Hi David,

    Some basic steps:

    1. The drawing is represented by the AcDbDatabase class (there's a
    acdbCurDwg macro to get the active database)
    2. There's a lot of tables in there, you're interested in the
    AcDbBlockTable
    3. Find the modelspace record (use the ACDB_MODEL_SPACE macro)
    4. Open it for write as an AcDbBlockTableRecord
    5. Add any lines (AcDbLine), arcs (AcDbArc) or circles (AcDbCircle) to
    the modelspace
    6. close all opened objects

    I'm getting close to releasing my own CAD software, due in January.
    Using that would be easier for you:

    1. Derive a command object from CommandStd
    2. Create any Line, Arc or Circle and add it using the Add
    memberfunction

    Good luck,

    Henrik Vallgren

    www.stream-space.com
    www.thecadproject.com
     
    HenrikV, Nov 26, 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.