การวาด DWT
Contents
[
Hide
]การสนับสนุนไฟล์ DWT
Aspose.CAD สำหรับ Java ช่วยให้ผู้พัฒนาสามารถโหลดและบันทึกไฟล์ DWT ได้ ตัวอย่างโค้ดด้านล่างให้เพื่อให้บรรลุฟีเจอร์นี้
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()) | |
{ | |
// ... | |
} | |
} |
การแยกแยะรูปแบบ DWT และ DWG
ด้านล่างนี้เป็นโค้ดที่แสดงวิธีการแยกแยะรูปแบบ DWT และ DWG โดยใช้ Aspose.CAD สำหรับ 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); |