إضافة خصائص مخصصة
Contents
[
Hide
]تعمل هذه الطريقة مع ملفات DXF و DWG على حد سواء.
إضافة خصائص مخصصة
يتيح لك Aspose.CAD لواجهة برمجة التطبيقات .NET إضافة خصائص مخصصة في ملفات 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-.NET | |
// The path to the documents directory. | |
string WorkingDir = RunExamples.GetDataDir_DXFDrawings(); | |
string fileName = "conic_pyramid.dxf"; | |
string inputFile = WorkingDir + fileName; | |
string outFile = WorkingDir + "AddMetadata_out.dxf"; | |
using (var cadImage = (CadImage)Image.Load(inputFile)) | |
{ | |
cadImage.Header.CustomProperties.Add("CUSTOM_PROPERTY_1", "Custom property test 1"); | |
cadImage.Header.CustomProperties.Add("CUSTOM_PROPERTY_2", "Custom property test 2"); | |
cadImage.Header.CustomProperties.Add("CUSTOM_PROPERTY_3", "Custom property test 3"); | |
cadImage.Save(outFile); | |
} |