Jump to content

Create a DXF programatically


DKT

Recommended Posts

I'm trying to create a DXF that contains a single rectangle of varying sizes through C#. Right now our CNC operators open up a cut file, stretch the file to the proper dimensions, save as a DXF and then open that file to be cut.

 

Because I have some C# code that runs during the order entry process, I'm trying to generate the cutfile at that time, rather than relying on the operator manually modifying a couple dozen cut files every day.

 

Is it possible to create a DXF file of a rectangle simply through c# code? Any help, code examples or just a point in the right direction would be greatly appreciated.

Link to comment
Share on other sites

DXF code is a plain text file so it can be written in c# its understanding the pattern or sequence of codes

 

Why would you not just look at some you already have a DXF has all sorts of info in it but it can also be extremely short and just contain relevent information like your 4 lines.

 

Something like this is 1 line

AcDbEntity

8

0

100

AcDbLine

10

100.0

20

100.0

30

0.0

11

0.0

21

100.0

31

0.0

Edited by BIGAL
Link to comment
Share on other sites

Sometimes the answer stares us in the face. :lol:

 

Just write a few functions line, arc & circle etc that write the correct dxf code.

 

Google DXF codes you should be able to find all the descriptions.

Link to comment
Share on other sites

  • 2 weeks later...

BIGAL is on the money.

 

 

If you can, emit the simplest DXF standard that the consuming software will tolerate (R12 DXF or even much earlier, say v2.6 before they introduced the entity handle)

 

 

ACAD added a heap of interrelated cruft to later versions that is totally irrelevant in specifying simple cutter paths.

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