AutoCAD 2000/2000i/2002 Archive

Reply
New Member
dougal harrisq
Posts: 1
Registered: ‎10-22-2007
Message 1 of 7 (1,530 Views)

lwpolyline in dxf

1530 Views, 6 Replies
10-22-2007 10:59 PM
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
New Member
cademia
Posts: 1
Registered: ‎07-25-2008
Message 2 of 7 (1,530 Views)

Re: lwpolyline in dxf

07-25-2008 01:12 AM 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
New Member
esilky
Posts: 1
Registered: ‎02-09-2010
Message 3 of 7 (1,530 Views)

Re: lwpolyline in dxf

02-17-2010 02:26 PM 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)
New Member
bradleymecham
Posts: 2
Registered: ‎11-14-2012
Message 4 of 7 (1,180 Views)

Re: lwpolyline in dxf

11-14-2012 01:44 PM in reply to: dougal harrisq

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

Employee
artc2
Posts: 195
Registered: ‎06-08-2010
Message 5 of 7 (1,174 Views)

Re: lwpolyline in dxf

11-15-2012 10:29 AM 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.

New Member
bradleymecham
Posts: 2
Registered: ‎11-14-2012
Message 6 of 7 (1,161 Views)

Re: lwpolyline in dxf

11-22-2012 12:33 PM 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
Employee
artc2
Posts: 195
Registered: ‎06-08-2010
Message 7 of 7 (1,159 Views)

Re: lwpolyline in dxf

11-23-2012 08:17 AM 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community




Connect with AutoCAD

Twitter

Facebook

Blogs

Pinterest

Youtube