Gambar DWT
Contents
[
Hide
]Dukungan untuk File DWT
Aspose.CAD untuk Java memungkinkan pengembang untuk memuat dan menyimpan file DWT. Kode contoh diberikan di bawah ini untuk mencapai fitur ini.
This file contains hidden or 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()) | |
{ | |
// ... | |
} | |
} |
Membedakan Format DWT dan DWG
Berikut adalah kode yang menunjukkan cara membedakan format DWT dan DWG menggunakan Aspose.CAD untuk Java.
This file contains hidden or 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); |