DWT Zeichnungen
Contents
[
Hide
]Unterstützung für DWT-Dateien
Aspose.CAD für Java ermöglicht Entwicklern das Laden und Speichern von DWT-Dateien. Im folgenden Beispielcode wird gezeigt, wie dieses Feature umgesetzt werden kann.
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()) | |
{ | |
// ... | |
} | |
} |
Unterscheidung von DWT- und DWG-Formaten
Nachfolgend wird der Code gezeigt, der veranschaulicht, wie man mit Aspose.CAD für Java zwischen DWT- und DWG-Formaten unterscheiden kann.
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); |