Create DXF file by using MATLAB

Create DXF file by using MATLAB

Anonymous
Not applicable
5,829 Views
3 Replies
Message 1 of 4

Create DXF file by using MATLAB

Anonymous
Not applicable
Hi everyone! I want to build an object by using Matlab, then use this file to import in ANSYS simulation for optimization. My trouble is create object in Autocad because i cant set parameter variable for it, so it is very hard to optimize parameters in object. I found this DXF script: https://www.mathworks.com/matlabcentral/fileexchange/33884-dxflib but it just some of tools. There are a lot of tools that need to complete the object. Anyone can help me with functions used in Matlab the same as in DXFLib above or show me how to create these files. When use "record function" in autocad, it doesnt generate script like that. Thank you so much!!
0 Likes
5,830 Views
3 Replies
Replies (3)
Message 2 of 4

TheCADnoob
Mentor
Mentor

Its been years since i have played with matlab. I read that you may be able to use octave (open source matlab type program) https://www.gnu.org/software/octave/ to export to dxf easily. i think octave also accepts .mat files. 

not sure if that helps, but it might be worth looking into. 

CADnoob

EESignature

Message 3 of 4

Anonymous
Not applicable
Hi, You can draw MATLAB calculation results in AutoCAD by "COM" object (ActiveX).
- connect to AtoCAD by ActiveX
- invoke the AutoCAD method to draw figure (point, line, arc, spline etc)

You can find a simple e-book in AMZON by searching "MATLAB+AutoCAD"

https://www.amazon.com/matlab-autocad-calculation-results-engineering-ebook/dp/B01MR0OJBA/ref=sr_1_1...
0 Likes
Message 4 of 4

Anonymous
Not applicable

I am trying to export my matlab plot to a .dxf format.
The easiest way to learn how to create DXF files using DXFLib is to simply run the dxf_test.m script and then open it in MATLAB editor and compare the generated DXF files with the code inside the script. Obviously, you'll need any DXF viewer that is capable to handle 3D content. DXFLib is a library written in MATLAB that allows to create simple AutoCAD DXF files. Autocad DXF is a popular file format that can be interpreted in many CAD-related applications.

 

0 Likes