I have dxf data file, I want to save with .3dm but I don’t know how to write this code in c#. Any suggestions?
You are looking to import .dxf to Rhino or to save out a .dxf from the Rhino .3dm format?
Search the forum for Batch import / Export, any of the .dwg scripts can be turned into .dxf
I write a software, it reads a dxf file and returns dxf data. Now I want to save the file with 3dm file
Is this software independent of Rhino or are you writing a Rhino plug-in?
this is software independent of Rhino
Use Rhino3dm available on nuget. You will need to create an instance of a File3dm class and add geometry to that instance. Once all of the geometry has been added you can save a File3dm instance to a 3dm file.
DxfModel dxfModel_0 // This is dxf data
File3dm file = new File3dm();
how to get data from DxfModel to File3dm
Rhino3dm neither reads nor writes AutoCAD DXF files. If you want to use RhinoCommon to read and write DXF files, you’ll need to use Rhino.
If your application is .NET based, then you might consider using Rhino.Inside. This allows you to use Rhino’s API inside of your application.
Dale is correct. I had assumed that you had code that reads and parses the contents of a DXF file. If you don’t parse the DXF file, then Rhino.Inside is the appropriate tool.
The application reads dxf files and writes 3dm files.
This is a .NET based application. I’m trying Rhino.Inside but don’t know how to use it.
Here are a few .NET samples you can review.