writing DXF files

  • Thread starter Thread starter Mif
  • Start date Start date
M

Mif

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 said:
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.

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
 
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.
 
Can't you just export a DXF from AutoCAD 2000 with a some entitys to a
ASCII file and look at the correct syntax?
 
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
 
Back
Top