DKT Posted March 2, 2017 Share Posted March 2, 2017 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. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 2, 2017 Share Posted March 2, 2017 (edited) 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 March 2, 2017 by BIGAL Quote Link to comment Share on other sites More sharing options...
DKT Posted March 6, 2017 Author Share Posted March 6, 2017 Didn't know DXF was plain text! Problem solved. Thanks so much. DKT Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 7, 2017 Share Posted March 7, 2017 Sometimes the answer stares us in the face. 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. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted March 7, 2017 Share Posted March 7, 2017 Looking at the _DXFOUT command may also be useful. It has the option to export only selected entities. Quote Link to comment Share on other sites More sharing options...
hugha Posted March 16, 2017 Share Posted March 16, 2017 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. 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.