Výkresy DWT
Contents
[
Hide
]Podpora pro soubory DWT
Aspose.CAD pro Java umožňuje vývojářům načítat a ukládat soubory DWT. Ukázkový kód je uveden níže k dosažení této funkce.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java | |
CadImage image = (CadImage)Image.load("example.dwt"); | |
{ | |
for (CadBaseEntity entity : image.getEntities()) | |
{ | |
// ... | |
} | |
} |
Rozlišení formátů DWT a DWG
Následující kód ukazuje, jak rozlišit formáty DWT a DWG pomocí Aspose.CAD pro Java.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String dataDir = Utils.getDataDir(DistinguishDWTAndDWGFormats.class) + "DWTDrawings/"; | |
String fileName2 = dataDir +"Sample.dwg"; | |
String fileName3 = dataDir +"sample.dwt"; | |
String fileName4 = dataDir +"sample.dxf"; | |
long formatType2 = Image.getFileFormat(fileName2); | |
Assert.areEqual(formatType2 >= FileFormat.CadR010 && formatType2 <= FileFormat.CadR2013); | |
long formatType3 = Image.getFileFormat(fileName3); | |
Assert.areEqual(formatType3 >= FileFormat.DwtCadR010 && formatType3 <= FileFormat.DwtCadR2013); | |
long formatType4 = Image.getFileFormat(fileName4); | |
Assert.areEqual(formatType4 >= FileFormat.DXFCadR010 && formatType4 <= FileFormat.DXFCadR2013); |