// BLASTED, GALVANIZED, PAINTED, PRIMED and ETC

        //protected BbPaintFinishApplied(BbElement hostElement, BbPaintFinish paintFinish, BbSurfaceGeometry shape, BbPosition3D localPlacement3D)
        //{
        //    if (hostElement == null) { throw new ArgumentNullException(); }
        //    if (hostElement.IfcObject == null) { throw new NullReferenceException(); }

        //    _hostElements.Add(hostElement);
        //    _paintFinishes.Add(paintFinish);



        //    //var ploc = BbLocalPlacement3D.Create(TheElement.ObjectBbLocalPlacement, localPlacement3D);
        //    //paintFinish.BbLocalPlacement3D = ploc;


        //    var bElement = hostElement.IfcObject as IfcElement;
        //    if (bElement == null){throw new InvalidCastException();}

        //    var relCovers = new IfcRelCoversBldgElements
        //    {
        //        GlobalId = IfcGloballyUniqueId.NewGuid(),
        //        OwnerHistory = BbHeaderSetting.Setting3D.IfcOwnerHistory,
        //        RelatingBuildingElement = bElement,
        //        RelatedCoverings = new List<IfcCovering>{paintFinish.IfcCovering},
        //    };

        //    IfcRelCoversBldgElementsList.Add(relCovers);

        //}



        ///// <summary>
        /////
        ///// </summary>
        ///// <param name="type">one of SemSurfaceTreatmentProperties</param>
        //protected BbPaintFinish()
        //    : this(@"FINISH", @"PAINTED")
        //{

        //    //IfcCovering = new IfcCovering
        //    //{
        //    //    GlobalId = IfcGloballyUniqueId.NewGuid(),
        //    //    OwnerHistory = BbHeaderSetting.Setting3D.IfcOwnerHistory,
        //    //    //Name = name,
        //    //    ObjectType = "FINISH",
        //    //    //Tag = id,
        //    //    PredefinedType = IfcCoveringTypeEnum.USERDEFINED,
        //    //    /// set propertySet value with type parameter value
        //    //};n
        //}



        //protected BbPaintFinishApplied(IfcCovering paint, IfcRelCoversBldgElements agg)
        //{

        //    _ifcCoveringList.Add(paint);
        //    _ifcRelCoversBldgElementsList.Add(agg);

        //}


        //public static BbPaintFinishApplied Create(BbElement hostElement, BbPaintFinish paintFinish, BbPosition3D localPlacement3D)
        //{
        //    var paintFinishes = new BbPaintFinishApplied(hostElement, paintFinish, localPlacement3D);

        //    BbInstanceDB.AddToExport(paintFinishes);

        //    return paintFinishes;
        //}


        //public static BbPaintFinish Create()
        //{
        //    var paintFinish = new BbPaintFinish();

        //    BbInstanceDB.AddToExport(paintFinish);

        //    return paintFinish;
        //}


        public void AddToOtherElement(BbElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException();
            }

            if (element.IfcObject == null)
            {
                throw new NullReferenceException();
            }


            var bElement = element.IfcObject as IfcElement;

            if (bElement == null)
            {
                throw new InvalidCastException();
            }

            var relCovers = new IfcRelCoversBldgElements
            {
                RelatingBuildingElement = bElement,
            };

            IfcRelCoversBldgElementsList.Add(relCovers);

            //PaintFinishes.Add(paintFinish);
        }
        // BLASTED, GALVANIZED, PAINTED, PRIMED and ETC
        //protected BbPaintFinishApplied(BbElement hostElement, BbPaintFinish paintFinish, BbSurfaceGeometry shape, BbPosition3D localPlacement3D)
        //{
        //    if (hostElement == null) { throw new ArgumentNullException(); }
        //    if (hostElement.IfcObject == null) { throw new NullReferenceException(); }
        //    _hostElements.Add(hostElement);
        //    _paintFinishes.Add(paintFinish);
        //    //var ploc = BbLocalPlacement3D.Create(TheElement.ObjectBbLocalPlacement, localPlacement3D);
        //    //paintFinish.BbLocalPlacement3D = ploc;
        //    var bElement = hostElement.IfcObject as IfcElement;
        //    if (bElement == null){throw new InvalidCastException();}
        //    var relCovers = new IfcRelCoversBldgElements
        //    {
        //        GlobalId = IfcGloballyUniqueId.NewGuid(),
        //        OwnerHistory = BbHeaderSetting.Setting3D.IfcOwnerHistory,
        //        RelatingBuildingElement = bElement,
        //        RelatedCoverings = new List<IfcCovering>{paintFinish.IfcCovering},
        //    };
        //    IfcRelCoversBldgElementsList.Add(relCovers);
        //}
        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="type">one of SemSurfaceTreatmentProperties</param>
        //protected BbPaintFinish()
        //    : this(@"FINISH", @"PAINTED")
        //{
        //    //IfcCovering = new IfcCovering
        //    //{
        //    //    GlobalId = IfcGloballyUniqueId.NewGuid(),
        //    //    OwnerHistory = BbHeaderSetting.Setting3D.IfcOwnerHistory,
        //    //    //Name = name,
        //    //    ObjectType = "FINISH",
        //    //    //Tag = id,
        //    //    PredefinedType = IfcCoveringTypeEnum.USERDEFINED,
        //    //    /// set propertySet value with type parameter value
        //    //};n
        //}
        //protected BbPaintFinishApplied(IfcCovering paint, IfcRelCoversBldgElements agg)
        //{
        //    _ifcCoveringList.Add(paint);
        //    _ifcRelCoversBldgElementsList.Add(agg);
        //}
        //public static BbPaintFinishApplied Create(BbElement hostElement, BbPaintFinish paintFinish, BbPosition3D localPlacement3D)
        //{
        //    var paintFinishes = new BbPaintFinishApplied(hostElement, paintFinish, localPlacement3D);
        //    BbInstanceDB.AddToExport(paintFinishes);
        //    return paintFinishes;
        //}
        //public static BbPaintFinish Create()
        //{
        //    var paintFinish = new BbPaintFinish();
        //    BbInstanceDB.AddToExport(paintFinish);
        //    return paintFinish;
        //}
        public void AddToOtherElement(BbElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException();
            }

            if (element.IfcObject == null)
            {
                throw new NullReferenceException();
            }

            var bElement = element.IfcObject as IfcElement;
            if (bElement == null)
            {
                throw new InvalidCastException();
            }

            var relCovers = new IfcRelCoversBldgElements
            {
                RelatingBuildingElement = bElement,

            };

            IfcRelCoversBldgElementsList.Add(relCovers);

            //PaintFinishes.Add(paintFinish);
        }