إضافة خصائص مخصصة
Contents
[
Hide
]تعمل هذه الطريقة مع كل من ملفات DXF و DWG.
إضافة خصائص مخصصة
تتيح لك واجهة برمجة التطبيقات Aspose.CAD لـ Java إضافة خصائص مخصصة في ملفات DXF و DWG. لهذا، توفر واجهة برمجة التطبيقات CadImage.Header.CustomProperties.Add الطريقة. توضح مقتطفات التعليمات البرمجية التالية كيفية إضافة خصائص مخصصة إلى ملف DXF باستخدام CadImage.Header.CustomProperties.Add الطريقة.
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 | |
String dataDir = Utils.getDataDir(ExportDXFToWMF.class) + "DXFDrawings/"; | |
String srcFile = dataDir + "conic_pyramid.dxf"; | |
String outFile = dataDir + "AddCustomProperties_out.dxf"; | |
CadImage cadImage = (CadImage)Image.load(srcFile); | |
cadImage.getHeader().getCustomProperties().put("CUSTOM_PROPERTY_1", "Custom property test 1"); | |
cadImage.getHeader().getCustomProperties().put("CUSTOM_PROPERTY_2", "Custom property test 2"); | |
cadImage.getHeader().getCustomProperties().put("CUSTOM_PROPERTY_3", "Custom property test 3"); | |
cadImage.save(outFile); |