Hello,
I try to save some data in CadImage header. CustomProperties should allow me to do this, but when I try to read the header, it turns out that the CustomProperties are empty. My testing code is shown below. Screenshoot added. Maybe I am doing something wrong? I would be grateful for any help.
headerIsEmpty.png (6.0 KB)
using (Image img = Image.Load("C://input.dwg"))
{
CadImage cad = img as CadImage;
cad.Header.CustomProperties.Add("test", "testingValue");
cad.Save("C://save.dxf", new DxfOptions()
{
VectorRasterizationOptions = new CadRasterizationOptions()
{
DrawType = CadDrawTypeMode.UseObjectColor,
PageHeight = 1600,
PageWidth = 1600
}
});
}
using (Image img = Image.Load("C://save.dxf"))
{
CadImage cad = img as CadImage;
string value = string.Empty;
Console.WriteLine(cad.Header.CustomProperties.Count);
if(cad.Header.CustomProperties.TryGetValue("test", out value))
{
Console.WriteLine(value);
}
}