C# how to save the layer as DXF?

(NehoLyg) #1

I have a problem,I have let the selected object(mesh) into my new layer,how can I save it as .dxf file ,dxf file name is the layer name?

(Dale Fugier) #2

Hi @NehoLyg,

Make a script runner command, and then call RhinoApp().RunScript("_-Export ...") .

– Dale

(NehoLyg) #3

thank you very much,Please forgive me for replying you so late,

,I use this method save SelectedObject in rhino,but the dxf file cannot open by autocad, use rhino can open that dxf file,Do you know why?
te100.dxf (181 KB)

(Dale Fugier) #4

Hi @NehoLyg,

Have you tried scripting the Export command?

– Dale

(NehoLyg) #5

No, because I must write in c#

(Dale Fugier) #6

Hi @NehoLyg,

Let me know if this sample helps.


– Dale

(NehoLyg) #7

Thank you very much,You helped me very much,I am watching your GitHub to study,you are a good man,


(NehoLyg) #8

What I want to achieve is to select multiple modules at a time. Each module is put into a new layer, and the module in each layer is stored separately in the DXF file.

The following is my writing,But it puts multiple modules in the same DXF.
Can you tell me what’s wrong?
Hello.cs (4.1 KB)