Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created August 16, 2022 18:02
Convert OBJ to DXF File Programmatically in C# .NET
// Load the OBJ file using the Image class
using (var image = Aspose.CAD.Image.Load("template.obj"))
{
// Create an object of CadRasterizationOptions class
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions()
{
PageWidth = 1600,
PageHeight = 1600
};
// Create an object of DxfOptions class
Aspose.CAD.ImageOptions.DxfOptions options = new Aspose.CAD.ImageOptions.DxfOptions();
// Set the VectorRasterizationOptions property
options.VectorRasterizationOptions = rasterizationOptions;
// Export OBJ to DXF
image.Save("output.dxf", options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment