DWT Drawings

Support for DWT Files

Aspose.CAD for .NET allows developers to load and save DWT files. Sample code is given below to achieve this feature.

Sample Code

// The path to the documents directory.
string MyDir = RunExamples.GetDataDir_ConvertingCAD();
using (CadImage image = (CadImage)Image.Load(MyDir+"example.dwt"))
{
foreach (CadBaseEntity entity in image.Entities)
{
//do your work here
}
}
}

Distinguish DWT and DWG Formats

Following is the code demonstrating how to distinguish DWT and DWG formats using Aspose.CAD for .NET.

Sample Code

var formatTypeDwt = Image.GetFileFormat(GetFileFromDesktop("sample.dwt"));
Assert.IsTrue(formatTypeDwt.ToString().ToLower().Contains("dwt"));
var formatTypeDwg = Image.GetFileFormat(GetFileFromDesktop("sample.dwg"));
Assert.IsTrue(formatTypeDwg.ToString().ToLower().Contains("dwg"));