writing dxf files

writing dxf files

Anonymous
Not applicable
984 Views
6 Replies
Message 1 of 7

writing dxf files

Anonymous
Not applicable
hello everyone
I am trying to insert a new entity (a LWPOLYLINE) inside an empty (is not
essential) dxf file using an text editor. One of the group codes describing
the polylines entities regards the HANDLE (code "5")(see at
http://www.autodesk.com/techpubs/autocad/acad2000/dxf/lwpolyline_dxf_06.htm
and
http://www.autodesk.com/techpubs/autocad/acad2000/dxf/common_group_codes_for
_entities_dxf_06.htm#XREF_22164_DXF_06)
. I do not know how to define the handle for the entity I want to insert.
Any suggestion is welcome.
Thanx
Bepcan
0 Likes
985 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Open a blank drawing, draw a lwpolyline on it. Execute DXFOUT and look at the code that is generated by AutoCAD. Make it the same as theirs. The DXF file is nothing more than an ASCII text file.

Joe
--
0 Likes
Message 3 of 7

Anonymous
Not applicable
As far as I know, you don't write the handle when
creating an object in a dxf file.  Just ignore this group code when you are
creating the polyline.

 

Rob


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Open
a blank drawing, draw a lwpolyline on it. Execute DXFOUT and look at the code
that is generated by AutoCAD. Make it the same as theirs. The DXF file is
nothing more than an ASCII text file.

Joe
--

0 Likes
Message 4 of 7

Anonymous
Not applicable
Well, AutoCAD is writing it to the DXF file. This is an excerpt from a file created using DXFOUT in AutoCAD. 2B is the handle of the LWPolyline.

Joe
--
ENTITIES
0
LWPOLYLINE
5
2B
0 Likes
Message 5 of 7

Anonymous
Not applicable
> I am trying to insert a new entity (a LWPOLYLINE) inside an empty (is not
> essential) dxf file using an text editor. One of the group codes describing
> the polylines entities regards the HANDLE (code "5")(see at
> http://www.autodesk.com/techpubs/autocad/acad2000/dxf/lwpolyline_dxf_06.htm
> and
> http://www.autodesk.com/techpubs/autocad/acad2000/dxf/common_group_codes_for
> _entities_dxf_06.htm#XREF_22164_DXF_06)
> . I do not know how to define the handle for the entity I want to insert.
> Any suggestion is welcome.

Write the files using an only style polyline. You don't need the handles
and all the other junk that Autodesk now requires in DXF files now for
some of the newer entity types. The following is all you would need for
a polyline.

This works because AutoCAD will support older file format versions of
DXF which didn't have nearly as much info. Once you start using newer
entities or items in the DXF file, AutoCAD then needs a lot more junk to
go with it to support them. Handles are just one of those things that's
needed in a newer DXF file version that isn't in the older ones.

--

Darren Young

Minnesota CADWorks, Inc.
PO Box 1172
Monticello, Minnesota 55362-1172


---snip---snip---snip--- Start DXF File
0
SECTION
2
ENTITIES
0
POLYLINE
8
0
66
1
10
0.0
20
0.0
30
0.0
0
VERTEX
8
0
10
2.725886
20
5.285
30
0.0
0
VERTEX
8
0
10
4.566485
20
5.285
30
0.0
0
SEQEND
8
0
0
ENDSEC
0
EOF
---snip---snip---snip--- End DXF File
0 Likes
Message 6 of 7

Anonymous
Not applicable
If you delete the lines with the "5" and the "2B"
from the DXF file and then do a dxfin in AutoCAD, you will see that the polyline
will be created.  If you list it, AutoCAD has automatically given it a
handle and it is not needed in the DXF file.  Unless you need to identify
that exact polyline at a later time, you will not need the handle.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Well,
AutoCAD is writing it to the DXF file. This is an excerpt from a file created
using DXFOUT in AutoCAD. 2B is the handle of the LWPolyline.

Joe
--
ENTITIES
  0
LWPOLYLINE
  5

2B

0 Likes
Message 7 of 7

Anonymous
Not applicable
Sorry:

I was using a AcadPolyline not
AcadLWPolyline


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

If you delete the lines with the "5" and the "2B"
from the DXF file and then do a dxfin in AutoCAD, you will see that the
polyline will be created.  If you list it, AutoCAD has automatically
given it a handle and it is not needed in the DXF file.  Unless you need
to identify that exact polyline at a later time, you will not need the
handle.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Well,
AutoCAD is writing it to the DXF file. This is an excerpt from a file
created using DXFOUT in AutoCAD. 2B is the handle of the LWPolyline.

Joe
--
ENTITIES
  0
LWPOLYLINE

  5
2B

0 Likes