Generating AutoCAD’s dxf file

Can any one assist by providing information or tutorial how to create a dxf file using swift and draw a line inside this file?

Some basic searching revealed nothing for Swift libraries that support DXF. However, there is libdxfrw, which is proven tested:

You may say wait! this is for C++. And that’s ok. C/C++/Objective-C can interoperate with Swift.

I saw this earlier and I learn basic of using c++ in swift.
but for such big library with 100 files ;), it is vey difficult.
Can you give just hints? :wink:

What I’ve done in the past is create a wrapper Framework, which contains the library code plus interfacing calls, then you include that library in your project. Keeps everything separate and clean.

That said, if you take a look at the DXF specification, you may be able to extract only what you need, thus eliminating the decency dependency of a library:

https://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3

1 Like

Thank you for your reply.
appreciated.

I will try this

This topic was automatically closed after 166 days. New replies are no longer allowed.