AutoCAD 2000/2000i/2002 Archive (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lwpolyline in dxf

6 REPLIES 6
Reply
Message 1 of 7
dougal harrisq
5723 Views, 6 Replies

lwpolyline in dxf

hi,

I am a developer trying to export a dxf file from my application with an lwpolyline entity. Below is a very simple 2 point lwpolyline file that i have exported from my application. When it is opened in ACAD however i get the error "Undefined group code 90 for object on line 8"
the simple file is:

0
SECTION
2
ENTITIES
0
LWPOLYLINE
90
2
10
0.000000
20
-3.5
10
1.000000
20
-3.00000
0
ENDSEC
0
EOF

any suggestions as to where i am going wrong. Or an example file that works would be great.
Cheers,
Dougal
6 REPLIES 6
Message 2 of 7
cademia
in reply to: dougal harrisq

hi,

i struggle with the same problem. why does it work with LINE and not with LWPOLYLINE? any suggestions?

cheers,
bert
Message 3 of 7
esilky
in reply to: dougal harrisq

Try adding in the Subclass marker at the beginning.
...
0
LWPOLYLINE
100
AcDbPolyline
90
2
...
There are also other values that are generally there:
5 = Handle
8 = Layer
70 = Polyline flag (0,1-closed,128-plinegen)
Message 4 of 7

It's the same with me.  I've tried adding each of those codes (100, 5, etc.), but to no avail.  My .dxf file opens fine and displays other shapes, solids, points, etc.  However, if I add the LWPOLYLINE code, the .dxf file will no longer open successfully.  What am I missing?  What am I doing wrong?  Here's my LWPOLYLINE code:

0
LWPOLYLINE
8
SHP
90
4
10
2.0
20
2.0
10
4.0
20
2.0
10
4.0
20
4.0

10

2.0

20

4.0
70
1
39
2.0

Message 5 of 7
artc2
in reply to: bradleymecham

Is your dxf file an entities only file (i..e only has an ENTITIES section)  like that of the original poster?  If so, then that won't work because AutoCAD considers entities only dxf files to be R12 version files and R12 didn't have lwpolylines.

 

Also, for lwpolyline you must have the group 100s - they are necessary for all entity types that are new since R12.

Message 6 of 7
bradleymecham
in reply to: artc2

Hey, thanks! This is exactly the kind of information I'm looking for. What is required other than the ENTITIES section? I have much more than that, but apparently it's not enough. I have a HEADER section, a TABLES section with some LAYERs specified, and the ENTITIES section. I added the 100s group codes, but that didn't make it work. What else must I have? Do I need the 5s group? The 330s group? And if the latter is required, where can I get some info about owners and what the 330s values should be? I could also include all of my file, but I don't know if that would be very helpful. Essentially I'm asking, what am I missing? CLASSES section? LTYPE table? I'm running AutoCAD for Mac, 2013 Bradley
Message 7 of 7
artc2
in reply to: bradleymecham

You shouldn't need the classes section.  You also should not need the 330 in the lwpolyline. But, you absolutely need the group 5 which is the polyline's handle.  Also, within the polyline's data you need to be sure that you have the right group codes after the right group 100s. The group 100s tell the dxf parser which C++ object class owns the data that follows so that class is then used to read in that data.

 

The best way to find out what is required and what is not is to use AutoCAD to create a dxf file of a polyline and then take that dxf file and start removing certain group codes and try to read the file back into AutoCAD.  If the group code isn't required, the file will read in, but if the group code is required, then the file won't read in.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report