andikatjacobdennis Posted January 31, 2014 Share Posted January 31, 2014 (edited) How to create a minimal DXF file that has polyline. I am using a C# program to create DXF File. Also if i want to hatch a closed polyline what might be the best way. Edited February 2, 2014 by andikatjacobdennis More info Quote Link to comment Share on other sites More sharing options...
MSasu Posted January 31, 2014 Share Posted January 31, 2014 What do you mean by create? The easiest way is to draw the polyline (PLINE or LINE/ARC + PEDIT), call PURGE command to get ride of un-used features and save the drawing as DXF Release 12 or 2000. If you are looking to generate that file from a third-part application, then open the above saved DXF from a text editor (i.e. NotePad) and follow its syntax; may find helpful to check the DXF Reference sheet. Quote Link to comment Share on other sites More sharing options...
eldon Posted January 31, 2014 Share Posted January 31, 2014 You can create a minimal DXF file consisting only of the ENTITIES section and following with the proper format for each vertex and then the end sequence. 0 SECTION 2 ENTITIES 0 POLYLINE 5 Quote Link to comment Share on other sites More sharing options...
BillK Posted February 1, 2014 Share Posted February 1, 2014 If you are going to be using the DXFOUT command, and if you are going to be exporting only a 2d view, then you may want to do a "FLATTEN" command... then hit the drawing with an "OVERKILL" command... This should minimize your DXF file output somewhat. Hope that helps. Quote Link to comment Share on other sites More sharing options...
eldon Posted February 1, 2014 Share Posted February 1, 2014 Unfortunately, the OP does not elaborate on how the DXF file is to be created. If one examines the DXF file created by saving a drawing as a DXF, there is a lot of extra information that is really not needed. My reading of the OP's request is the need to write a DXF text file, with minimal information, that creates a polyline when opened in AutoCAD. But we should wait until there is word from andikatjacobdennis. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 1, 2014 Share Posted February 1, 2014 Unfortunately, the OP does not elaborate on how the DXF file is to be created. What is the dxf to be used for ? Whats wrong with dxfout like above just edit a simple 1 pline dxf if you want simplest removing sections till you find what will still work. Quote Link to comment Share on other sites More sharing options...
eldon Posted February 2, 2014 Share Posted February 2, 2014 Whats wrong with dxfout like above just edit a simple 1 pline dxf if you want simplest removing sections till you find what will still work. The OP might not have a drawing to start with. What then? I see that the OP has edited the first post. How annoying and out of sequence, and makes many of the responses redundant Quote Link to comment Share on other sites More sharing options...
eldon Posted February 2, 2014 Share Posted February 2, 2014 andikatjacobdennis, I see that you have provided more information by editing the first post. It is usual to reply in sequence, as in a normal conversation, then responses do not seem to be off topic, but merely guessing from the information initially provided. If you have the coordinates of the closed Polyline, then you also have the coordinates for a hatch boundary. Quote Link to comment Share on other sites More sharing options...
andikatjacobdennis Posted February 3, 2014 Author Share Posted February 3, 2014 How do we link a hatch with a particular closed polyline. A sample dxf file would be great. Quote Link to comment Share on other sites More sharing options...
eldon Posted February 3, 2014 Share Posted February 3, 2014 There are quite a few different hatches. Had you thought of which one you want to use? Looking at a DXF file that includes a hatch, it seems that you have to define an unnamed block which defines every line of the hatch, and also the hatch pattern, amongst other things. Far too complicated for me, so I will bow out. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 4, 2014 Share Posted February 4, 2014 andikatjacobdennis if your trying to write a dxf from scratch using a program then give up and just go straight to writing a dwg, there is toolkits available for writing dwg's I think if you search under stuff like free software alliance. The toolkit has been around for a long time initailly as dxf before going to DWG. Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 4, 2014 Share Posted February 4, 2014 BIGAL, that's an interesting suggestion, but it may be that OP is looking to use that output for a third-part application where the DXF format is mandatory (i.e. a CNC processor). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.