Disegni DWT

Supporto per file DWT

Aspose.CAD per .NET consente agli sviluppatori di caricare e salvare DWT file. Il codice di esempio è fornito di seguito per raggiungere questa funzionalità.

Codice di Esempio

// 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
}
}
}

Distinguere i formati DWT e DWG

Di seguito è riportato il codice che dimostra come distinguere i formati DWT e DWG utilizzando Aspose.CAD per .NET.

Codice di Esempio

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"));