IFC Zeichnungen

IFC-Format nach PNG exportieren

Aspose.CAD für .NET ermöglicht Entwicklern, eine IFC Datei nach PNG zu exportieren. Nachfolgend finden Sie den Code, der zeigt, wie Sie auf die IFC-Datei zugreifen und diese mithilfe von CadRasterizationOptions und PngOptions in PNG umwandeln.

Beispiel Code

//Setfile name path as other examples
string MyDir = RunExamples.GetDataDir_ConvertingCAD();
string sourceFilePath = MyDir + "example.ifc";
using (IfcImage cadImage = (IfcImage)Image.Load(sourceFilePath))
{
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = 100;
rasterizationOptions.PageHeight = 100;
PngOptions pngOptions = new PngOptions();
pngOptions.VectorRasterizationOptions = rasterizationOptions;
//Set output path as well
string outPath = sourceFilePath + ".png";
cadImage.Save(outPath, pngOptions);
}
}