static IList <double> GetColor(Asset asset)
        {
            AssetPropertyDoubleArray3d color = asset.FindByName("filterColor") as AssetPropertyDoubleArray3d;

            if (color != null)
            {
                return(color.GetValueAsDoubles());
            }

            return(null);
        }
            private static Tuple <Type, Object> GetTypeAndValue(AssetProperty assetProperty, int level)
            {
                Object theValue;
                Type   valueType;

                //For each AssetProperty, it has different type and value
                //must deal with it separately
                try
                {
                    if (assetProperty is AssetPropertyBoolean)
                    {
                        AssetPropertyBoolean property = assetProperty as AssetPropertyBoolean;
                        valueType = typeof(AssetPropertyBoolean);
                        theValue  = property.Value;
                    }
                    else if (assetProperty is AssetPropertyDistance)
                    {
                        AssetPropertyDistance property = assetProperty as AssetPropertyDistance;
                        valueType = typeof(AssetPropertyDistance);
                        theValue  = property.Value;
                    }
                    else if (assetProperty is AssetPropertyDouble)
                    {
                        AssetPropertyDouble property = assetProperty as AssetPropertyDouble;
                        valueType = typeof(AssetPropertyDouble);
                        theValue  = property.Value;
                    }
                    else if (assetProperty is AssetPropertyDoubleArray2d)
                    {
                        //Default, it is supported by PropertyGrid to display Double []
                        //Try to convert DoubleArray to Double []
                        AssetPropertyDoubleArray2d property = assetProperty as AssetPropertyDoubleArray2d;
                        valueType = typeof(AssetPropertyDoubleArray2d);
                        theValue  = GetSystemArrayAsString(property.Value);
                    }
                    else if (assetProperty is AssetPropertyDoubleArray3d)
                    {
                        AssetPropertyDoubleArray3d property = assetProperty as AssetPropertyDoubleArray3d;
                        valueType = typeof(AssetPropertyDoubleArray3d);
                        //theValue = GetSystemArrayAsString( property.Value ); // 2017
                        theValue = Util.DoubleArrayString(property.GetValueAsDoubles()); // 2018
                    }
                    else if (assetProperty is AssetPropertyDoubleArray4d)
                    {
                        AssetPropertyDoubleArray4d property = assetProperty as AssetPropertyDoubleArray4d;
                        valueType = typeof(AssetPropertyDoubleArray4d);
                        //theValue = GetSystemArrayAsString( property.Value ); // 2017
                        theValue = Util.DoubleArrayString(property.GetValueAsDoubles()); // 2018
                    }
                    else if (assetProperty is AssetPropertyDoubleMatrix44)
                    {
                        AssetPropertyDoubleMatrix44 property = assetProperty as AssetPropertyDoubleMatrix44;
                        valueType = typeof(AssetPropertyDoubleMatrix44);
                        theValue  = GetSystemArrayAsString(property.Value);
                    }
                    else if (assetProperty is AssetPropertyEnum)
                    {
                        AssetPropertyEnum property = assetProperty as AssetPropertyEnum;
                        valueType = typeof(AssetPropertyEnum);
                        theValue  = property.Value;
                    }
                    else if (assetProperty is AssetPropertyFloat)
                    {
                        AssetPropertyFloat property = assetProperty as AssetPropertyFloat;
                        valueType = typeof(AssetPropertyFloat);
                        theValue  = property.Value;
                    }
                    else if (assetProperty is AssetPropertyInteger)
                    {
                        AssetPropertyInteger property = assetProperty as AssetPropertyInteger;
                        valueType = typeof(AssetPropertyInteger);
                        theValue  = property.Value;
                    }
                    else if (assetProperty is AssetPropertyReference)
                    {
                        AssetPropertyReference property = assetProperty as AssetPropertyReference;
                        valueType = typeof(AssetPropertyReference);
                        theValue  = "REFERENCE"; //property.Type;
                    }
                    else if (assetProperty is AssetPropertyString)
                    {
                        AssetPropertyString property = assetProperty as AssetPropertyString;
                        valueType = typeof(AssetPropertyString);
                        theValue  = property.Value;
                    }
                    else if (assetProperty is AssetPropertyTime)
                    {
                        AssetPropertyTime property = assetProperty as AssetPropertyTime;
                        valueType = typeof(AssetPropertyTime);
                        theValue  = property.Value;
                    }
                    else
                    {
                        valueType = typeof(String);
                        theValue  = "Unprocessed asset type: " + assetProperty.GetType().Name;
                    }

                    if (assetProperty.NumberOfConnectedProperties > 0)
                    {
                        String result = "";
                        result = theValue.ToString();

                        TaskDialog.Show("Connected properties found", assetProperty.Name + ": " + assetProperty.NumberOfConnectedProperties);
                        IList <AssetProperty> properties = assetProperty.GetAllConnectedProperties();

                        foreach (AssetProperty property in properties)
                        {
                            if (property is Asset)
                            {
                                // Nested?
                                Asset asset = property as Asset;
                                int   size  = asset.Size;
                                for (int i = 0; i < size; i++)
                                {
                                    //AssetProperty subproperty = asset[i]; // 2018
                                    AssetProperty        subproperty  = asset.Get(i); // 2019
                                    Tuple <Type, Object> valueAndType = GetTypeAndValue(subproperty, level + 1);
                                    String indent = "";
                                    if (level > 0)
                                    {
                                        for (int iLevel = 1; iLevel <= level; iLevel++)
                                        {
                                            indent += "   ";
                                        }
                                    }
                                    result += "\n " + indent + "- connected: name: " + subproperty.Name + " | type: " + valueAndType.Item1.Name +
                                              " | value: " + valueAndType.Item2.ToString();
                                }
                            }
                        }

                        theValue = result;
                    }
                }
                catch
                {
                    return(null);
                }
                return(new Tuple <Type, Object>(valueType, theValue));
            }