Jump to content

Minimal DXF File


andikatjacobdennis

Recommended Posts

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 by andikatjacobdennis
More info
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :shock:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...