writing DXF files

Discussion in 'AutoCAD' started by Mif, Mar 10, 2006.

  1. Mif

    Mif Guest

    Hi all, i am trying to write a dxf 2000 file and i'm haveing a few
    problems and wondered if anyone could help. I have read all the
    documentation that i can find on the subject and i can create a blank
    dxf 200 file, the problem is when i draw some entities in my code, when
    i open the file in autocad i get an error in the group 5 code for my
    entities i have no idea what to set these as ? can anyone shed any
    light ?

    regards

    Matt.
     
    Mif, Mar 10, 2006
    #1
  2. I walked through my code yesterday and I think that group code 5 is the
    objectid/entity name. I think that you can do without it. I think that
    there's a DXF sample somwhere on "the code project". Google for it!

    Anyway, if you're doing anything more complex, I'd recommend that you
    join the Open Design Alliance (formerly OpenDWG). You'd get DWG/DXF and
    both read/write capabilities. It's free for personal use.

    Best Regards,
    Henrik Vallgren
    www.streamspace.com
     
    Henrik Vallgren, Mar 10, 2006
    #2
  3. Mif

    Mif Guest

    Thanks for the reply Henrik, i have tried ommiting the group code 5 but
    this just causes more errors to occur when opening the dxf file, i can
    ommit the header info and the group code 5 but then my dxf is opened as
    R12 by autocad and i need it to be a 2000 file. I have had a look at
    the openDWG and have not yet looked at there libraries as i already
    have a C++ class written in house that creates valid R12 DXF
    files....... the only problem is with upgrading this existing class to
    version 2000 files all the header info that needs to be added as well
    as the group code 5 handle which is where i'm struggling to find a
    valid id.

    Regards

    Matt.
     
    Mif, Mar 13, 2006
    #3
  4. Mif

    huggre Guest

    Can't you just export a DXF from AutoCAD 2000 with a some entitys to a
    ASCII file and look at the correct syntax?
     
    huggre, Mar 27, 2006
    #4
  5. The group 5 is the entity id which is an unsigned integer written in
    hex. Here's a part of a circle:

    0
    CIRCLE
    5
    7E8

    It might be required to keep that id in order so that an owned entity
    has s higher id value than it's owner. E.g. you can't add something to
    modelspace before modelspace is actually created ...

    Henrik Vallgren
    www.streamspace.com
     
    Henrik Vallgren, Mar 29, 2006
    #5
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.