Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble getting DXF code right for ellipse 1

Status
Not open for further replies.

oxr76

Computer
Dec 14, 2006
3
0
0
AU
Hi,

I was wondering if anyone might be able to help me here. I was trying to write DXF code for drawing an Ellipse. So here is what i did. I got the code by drawing an ellipse and then saved it as DXF. So I started off with a blank page. I began writing it as follows

0
SECTION
2
ENTITIES
0
ELLIPSE
8
0
10
629.4185943561319
20
564.6465625762273
30
0.0
11
0.0
21
-182.0310286257299
31
0.0
210
0.0
220
0.0
230
1.0
40
0.3696612519921331
41
0.0
42
6.283185307179586
0
ENDSEC
0
EOF

I got an error while opening this DXF drawing. it said that "Undefined group code 10 for object on line 10"

I thought 10 denotes the X-Coordinates. Why is the autocad not able to define it?

Thank you in advance
 
Replies continue below

Recommended for you

Thank you Exxit for your reply.

I think i've got everything already based on the link you gave me. but it keeps on saying undefined group code 10. How do i define group code 10?

I don't know. This thing has driven me mad. I don't know if i should choose other shape. Ellipse is an ideal shape for my project. But i can't get it to work.

Is there anyone might have tried drawing ellipse using DXF code before that works? I'd really appreciate it.

Thank you in advance
 
oxr76,
Your DXF file opens just fine in every viewer and Cad program that I have. I suspect that you can get Autocad to open it as an earlier format. Which version do you need this DXF to open in? You may need the expert advice of someone familiar with the later versions.
 
oxr76,
Correction : I couldn't open your DXF in Voloview Express 2.01 . Evidently Autodesk's idea of a minimal CAD file is more elaborate than seems necessary.
 
Hi CADMILES,

Thank you for your reply.

I was trying to open it via AutoCAD 2005. But it failed to open it giving me the error i described earlier.

Which AutoCAD program do you use if i may ask?

Thank you in advance
 
oxr76,
I don't have Autocad. I use Intellicad V4 Standard. I also have Cadkey 19, used mostly for its STEP and IGES translators. Both Cadkey and Intellicad can read and write Autocad 2000 DWG and DXF and earlier files.
Mike Halloran reports he couldn't open your DXF in Autocad 2000, but if I load your DXF in Intellicad and save it as Autocad 2000 DWG, I can open it with Voloview, which is an Autodesk product and presumably recognizes all valid file versions! I am sorry I can't be of any more help. I have no experience writing DXF from scratch and I don't know what may be missing in your code.
 
I pasted the part between ELLIPSE and ENDSEC into a DXF generated by AutoCAD for a different ellipse, and that file opened up just fine. But it was 16 kilobytes, and includes a lot of crap having to do with my defaults.

Which means that AutoCAD is expecting more of a preamble than you have provided, but I'm not sure how little it can be. Try re-reading the DXF documentation from AutoCAD.





Mike Halloran
Pembroke Pines, FL, USA
 
Long time ago (ahem) I did some work on CNC programming using font files, and was able to generate a DXF file via MS-Basic.
When you typed in some text and chose a font; (plus slant, orientation, scale, etc) the program placed the appropriate codes into the DXF file. This was in ACAD14
Only when I attempted running this in Acad2000 did I encounter difficulties as the DXF file did not have the same expected inputs as before for each successive line.
I re-wrote the prog to get around that snag and all was ok. Eventually the company went with a commercial program for font needs; so it became obsolete.

During the trial and error procees, I would output a short DXF file just to see the order of inputs that ACAD was expecting.
What's required in Line10 should show up if you output a file to see what ACAD puts there.
 
I did that. Line 10 is perfectly legitimate. Something that does or does not come before it is confusing AutoCAD's parser.



Mike Halloran
Pembroke Pines, FL, USA
 
If memory serves, seems that in ACAD2000 (as compare R14)there was a bunch of "extra junk" in the beginning of the DXF file that preceeded the 1st co-ordinate value (x).

Don't know how or why this would affect the line following the 10 code, but I can look at work tomorrow and see what the Basic program was coding into the DXF file we were using.
Gatz
 
Some of this is coming back to me...
I recall that even tho' some of the coding in the beginning of the DXF file looked to be superfluous, it was needed for ACAD to accept the file in version 2000 as compared to R14.

As noted, I'll look tomorrow and see if there's a short sample of a DXF that we had generated before.

 
Well, after about 4 hours trying to get an ellipse DXF file (output by ACAD2000) trimmed down to the bare essentials so that it could be generated quickly by hand, I've failed to find the right sequence of coded lines that AutoCad wants to see.
I had pared down a 13kb file to about 10, and kept deleting portions or sections of the file that didnt appear to be necessary, but kept running into either Fatal Errors when trying to load or things like "Document has no Namespace" ....whatever the heck that means, or Error in Line 10, etc.

Seems like every attempted change brought new errors.

BTW, AutoCad tells you in the documentation about DXF codes, that Errors for a certain line don't necessarily mean THAT line....the error could have been generated from somewhere else in the file.


A DXF file for a line was very simple and didn't require any extraneous info and was loaded back in with no hitches.
Polylines didnt present any problems either.

Sorry I couldn't help out more. I know how frustrating these kinds of things can be.
Gatz


 
I'm curious too.

ISTR the AutoCAD DXF documentation included some not too subtle insults aimed at people who write parsers that get confused by unexpected input and post unintelligible error messages in response.

Indeed.


Mike Halloran
Pembroke Pines, FL, USA
 
Status
Not open for further replies.
Back
Top