For Custom type attributes, the returned values are strings in binary form. This article provides examples of how to decode the value of the ADDT custom attribute in SystemWeaver. 


Example 

{'attributeType': {'dataDimension': 'Single', 'dataType': 'Custom', 'handle': 'x16000000000C68DE', 'name': 'Design Datatype', 'sid': 'ADDT'}, 'value': 'eJyVUV0LgkAQnJ8i/QHLXq+DPkEIX4zer7Q4UBO1oH5942rRh0U93LI7OzO7d6cwQ4wSFntkzA0qOWfkxJ17NkKPMcMRKTMNhTV5CesYq5ajMYHPasE4x5JuCm4nT5Fp6R0yXgTxhPuKKvo0M+std0+IgykOiNrd+rKVz57Blh4WJ3Zqzxv/s3Yg2vHfOk90Ie9kUPysGooqIFKxYzjPcGrCuGF8d3E73iAgO2UVPbxuSWbD//ajGld1qFQk'}

C#

using System;
using SystemWeaver.Common.Internal;
namespace CustomAttribute{
    class Program    {
        static void Main(string[] args)
        {
            var zippedXml = Convert.FromBase64String("eJyVUV0LgkAQnJ8i/QHLXq+DPkEIX4zer7Q4UBO1oH5942rRh0U93LI7OzO7d6cwQ4wSFntkzA0qOWfkxJ17NkKPMcMRKTMNhTV5CesYq5ajMYHPasE4x5JuCm4nT5Fp6R0yXgTxhPuKKvo0M+std0+IgykOiNrd+rKVz57Blh4WJ3Zqzxv/s3Yg2vHfOk90Ie9kUPysGooqIFKxYzjPcGrCuGF8d3E73iAgO2UVPbxuSWbD//ajGld1qFQk");
            var xmlString = SWCompression.ZDecompressToString(zippedXml);
            Console.WriteLine(xmlString);
        }
    }
}


Python

import base64
import zlib

zlib_bytes = base64.b64decode('eJx9kltrwkAQhc9Pkb5LSqvQh22g1jwaH3p5X20iAY0So2h/fb+daL0QwrJk5pwzM2eHOI2VaatCC5XEXrXdozbgvf/oVQ/wO600I6vIYjl9o12CZvo86WJ9KeVO9AIftSocikunMD83dIKLkujRKs9ZwL0ORE8achquQZw+cJjRN7CBueROb5pzdszwfI+GRa3oiFk1tYV+zWHj/R51muI0Z1sZeKy+nk13iwak/X0pE1dkP1db2RqTnHbb07vW8M2+w3sHtumEPhVMZd3P6u7KoVWmoDWs155bMNXja4nuvlPU4S/q/Eti/QE0m2LL')

xml_string = zlib.decompress(zlib_bytes).decode('utf-16')