Exporting to DXF

Discussion in 'AutoCAD' started by chadidjaja, Aug 30, 2004.

  1. chadidjaja

    chadidjaja Guest

    Good day,

    I've a project to export drawing to dxf files not using VBA.
    We have our own object model of arcs, lines, dimension lines. We then write a text file line by line with each necessary group code and the value.

    My problem is when exporting dimension line. Could anyone help what group codes/blocks/entities needed to export a dimension line correctly?

    Thanks much,
    Christian
     
    chadidjaja, Aug 30, 2004
    #1
  2. chadidjaja

    Ed Jobe Guest

    If you're "not" using vba, then why post here?

    --
    ----
    Ed
    ----
    write a text file line by line with each necessary group code and the value.
    codes/blocks/entities needed to export a dimension line correctly?
     
    Ed Jobe, Aug 30, 2004
    #2
  3. chadidjaja

    Ed Jobe Guest

    That would be hard without more info the limitations of your project. It
    sounds like your trying to "translate" acad's entities into dxf, generating
    your own dxf file rather than DXFOUT, so that some other cad or cnc software
    can read it. But why not vb? Are you limited to lisp? As far as the
    dimension group codes go, they are all listed in the dxf reference of the
    developer's guide.
     
    Ed Jobe, Aug 30, 2004
    #3
  4. Draw dimensions (Linear, Angular,etc.) in Autocad.
    execute the "dxfout" command
    Look at the resulting dxf file for your answers.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


    write a text file line by line with each necessary group code and the value.
    codes/blocks/entities needed to export a dimension line correctly?
     
    Jorge Jimenez, Aug 30, 2004
    #4
  5. chadidjaja

    chadidjaja Guest

    That would be hard without more info the limitations of your project. Itsounds like your trying to "translate" acad's entities into dxf, generatingyour own dxf file rather than DXFOUT, so that some other cad or cnc softwarecan read it.
    ----> Correct

    But why not vb? Are you limited to lisp?
    ----> No, I'm using VB to read and write the DXF using the group codes. I'm not using VBA library since some of our clients (like the sales people) doesn't have AutoCAD.

    The DXF reference helps for reading the dimension lines. For exporting, it doesn't help much.
     
    chadidjaja, Aug 31, 2004
    #5
  6. chadidjaja

    Ed Jobe Guest

    What are you translating to?
    VB might not help, since you still require an instance of acad to read the
    file, which means acad has to be installed on the machine running your app.
    Unless you're using OpenDwg.
    I don't know why it doesn't help on writing. Did you try Jorge's suggestion?
    Since you're translating into your own "object model", just translate the
    dims into lines and text, or whatever you are using for your model.

    --
    ----
    Ed
    ----
    Itsounds like your trying to "translate" acad's entities into dxf,
    generatingyour own dxf file rather than DXFOUT, so that some other cad or
    cnc softwarecan read it.
    I'm not using VBA library since some of our clients (like the sales people)
    doesn't have AutoCAD.
    doesn't help much.
     
    Ed Jobe, Aug 31, 2004
    #6
  7. chadidjaja

    chadidjaja Guest

    Thanks to Ed and Jorge:
    dxfout is the same as saving as dxf, which doesn't help quite much.

    In more detail:
    I only use DXF ASCII format files.
    We parse line-by-line of the DXF file being read, read the group codes, and translate them into our own line, arc, and dimension line object model.
    This works fine.

    When exporting, we basically write a text file containing the group codes and the value. This works okay with line and arc, as they are single entities.
    However when it comes to dimension line, a block and several entities are generated. If I only put the group codes and values as the DXF reference says, it doesn't work. In order to work, all the needed entities need to be set up correctly.
    I guess what I'm seeking is what's needed to correctly setup that dimension line configuration.
     
    chadidjaja, Aug 31, 2004
    #7
  8. chadidjaja

    chadidjaja Guest

    Please see below Jorge answer.

    Also, only exporting dims into line and text won't work.
    The reason is when I read them back in, they are represented as line and text, not dims.
     
    chadidjaja, Aug 31, 2004
    #8
  9. I guess we're not getting thru to each other.
    Let me put it this way, if you need to see how a dim should be written in
    DXF format:
    1. Open a new drawing
    2. Draw a linear dimension between two points (known points like 2,2 and 5,5
    so you can trace it better inside the dxf file)
    3. Save as DXF
    4. Close AutoCAD
    5. Open the DXF file using a text editor
    6. Look and learn

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    and translate them into our own line, arc, and dimension line object model.
    and the value. This works okay with line and arc, as they are single
    entities.
    generated. If I only put the group codes and values as the DXF reference
    says, it doesn't work. In order to work, all the needed entities need to be
    set up correctly.
    dimension line configuration.
     
    Jorge Jimenez, Aug 31, 2004
    #9
  10. chadidjaja

    Ed Jobe Guest

    We can't tell you how to set it up correctly. We don't even know what you
    are translating to. DXF is the most basic, generic file format for a dwg
    that you can get. This is intended to not need translating. Therefore, all
    entities are represented as simply as possible. If you dsfout and then
    dxfin, you get lines, not dims. Think of a dim as being exploded. If you
    want to dxfout a dim, you will have to put it back together on your own.
    Perhaps your algorithm needs rethinking. Can you read an
    AcadRotatedDimension and translate its properties in a way that describes an
    entity in your other application? What does your application need in order
    to create a dimension object?

    --
    ----
    Ed
    ----
    and translate them into our own line, arc, and dimension line object model.
    and the value. This works okay with line and arc, as they are single
    entities.
    generated. If I only put the group codes and values as the DXF reference
    says, it doesn't work. In order to work, all the needed entities need to be
    set up correctly.
    dimension line configuration.
     
    Ed Jobe, Aug 31, 2004
    #10
  11. chadidjaja

    chadidjaja Guest

    Dear Ed and Jorge, thank you.

    I only need AlignedDimension for now. I'm following Jorge's suggestion to study the dxfout. I think that's the best option I have now.
    What I'll do is write a dimension line dxf codes and see if it can be read correctly by AutoCAD. If it does, I'm done.

    Thanks!
     
    chadidjaja, Sep 2, 2004
    #11
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.