Convert CF2 to FBX in C#

CAD applications use CF2 files for creating 2D or 3D drawings. Specifically, we can create and save designs for construction projects such as highways, bridges, and buildings in a CF2 file. In certain cases, we may need to export drawings from CF2 files to FBX documents programmatically. Such conversions allow sharing of drawings in a portable format. In this article, we will learn how to convert a CF2 file to a FBX in C#.

The following topics shall be covered in this article:

  1. C# CF2 to FBX Converter – Free Download
  2. Steps to Convert CF2 File to FBX Document
  3. Convert CF2 to FBX Programmatically
  4. Export CF2 to FBX with Options

C# CF2 to FBX Converter – Free Download

To convert a CF2 file to a FBX document, we will be using the Aspose.CAD for .NET API. It allows creating, editing, and manipulating CF2 files and several other file formats.

The Image class of the API is the base class for all types of drawings. The Cf2Image class represents a CF2 image. We can set PageWidth and PageHeight properties using the CadRasterizationOptions class. The FbxOptions class of the API allows specifying the FBX options.

Please either download the DLL of the API or install it using NuGet.

PM> Install-Package Aspose.CAD

How to Convert CF2 File to FBX using C#

We can easily convert a CF2 file to a FBX document using Aspose.CAD for .NET by following the steps given below:

  • Load a CF2 drawing file.
  • Save CF2 as FBX.

Now, let’s see how to perform these steps in C# to convert a CF2 file to a FBX document.

Convert CF2 to FBX Programmatically in C#

Please follow the steps given below to convert a CF2 to a FBX:

  1. Firstly, load an input CF2 file using the Image class.
  2. After that, create an instance of the FbxOptions class.
  3. Finally, call Save() method to save it as a FBX. It takes the output FBX file path and FbxOptions as arguments.

The following code sample shows how to convert a CF2 file to a FBX document using C#.

Export CF2 to FBX with Options in C#

We can specify FBX save options while converting a CF2 file to a FBX document by following the steps given below:

  1. Firstly, load an input CF2 file using the Image class.
  2. Next, create an instance of the CadRasterizationOptions class.
  3. Then, specify the page height and width.
  4. Next, create an instance of the FbxOptions class.
  5. After that, set the VectorRasterizationOptions property as CadRasterizationOptions.
  6. Finally, call Save() method to save it as a FBX. It takes the output FBX file path and FbxOptions as arguments.

The following code sample shows how to specify the page height and width while saving a CF2 file as a FBX document using C#.

Get Free Temporary License

You can get a free temporary license to try the library without evaluation limitations.

Conclusion

In this article, we have learned how to:

  • load an existing CF2 drawing file;
  • specify page height and width;
  • define save options;
  • save CF2 as a FBX in C#.

Besides converting a CF2 to a FBX in C#, you can learn more about Aspose.CAD for .NET API using the documentation. In case of any ambiguity, please feel free to contact us on our free support forum.

See Also