/// <summary>
      /// Creates a handle representing an IfcPile and assigns it to the file.
      /// </summary>
      /// <param name="file">The file.</param>
      /// <param name="guid">The GUID for the entity.</param>
      /// <param name="ownerHistory">The IfcOwnerHistory.</param>
      /// <param name="name">The name.</param>
      /// <param name="description">The description.</param>
      /// <param name="objectType">The object type.</param>
      /// <param name="objectPlacement">The local placement.</param>
      /// <param name="representation">The geometric representation of the entity, in the IfcProductRepresentation.</param>
      /// <param name="elementTag">The tag for the identifier of the element.</param>
      /// <param name="preDefinedType">The pile type.</param>
      /// <param name="constructionType">The optional material for the construction of the pile.</param>
      /// <returns>The handle.</returns>
      public static IFCAnyHandle CreatePile(IFCFile file, string guid, IFCAnyHandle ownerHistory,
          string name, string description, string objectType, IFCAnyHandle objectPlacement,
          IFCAnyHandle representation, string elementTag, string preDefinedType, IFCPileConstructionEnum? constructionType)
      {
         string validatedType = preDefinedType;
         string validatedConstructionType;

         ValidateElement(guid, ownerHistory, name, description, objectType, objectPlacement, representation, elementTag);

         IFCAnyHandle pile = CreateInstance(file, IFCEntityType.IfcPile);

         if (ExporterCacheManager.ExportOptionsCache.ExportAs4)
         {
            validatedType = IFCValidateEntry.ValidateStrEnum<IFC4.IFCPileType>(preDefinedType);
            validatedConstructionType = IFCValidateEntry.ValidateStrEnum<IFC4.IFCPileConstruction>(constructionType.ToString());
         }
         else
         {
            validatedType = IFCValidateEntry.ValidateStrEnum<IFCPileType>(preDefinedType);
            validatedConstructionType = IFCValidateEntry.ValidateStrEnum<IFCPileConstructionEnum>(constructionType.ToString());
         }

         IFCAnyHandleUtil.SetAttribute(pile, "PredefinedType", validatedType, true);
         IFCAnyHandleUtil.SetAttribute(pile, "ConstructionType", validatedConstructionType, true);
         SetElement(pile, guid, ownerHistory, name, description, objectType, objectPlacement, representation, elementTag);
         return pile;
      }
        /// <summary>
        /// Creates a handle representing an IfcPile and assigns it to the file.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="guid">The GUID for the entity.</param>
        /// <param name="ownerHistory">The IfcOwnerHistory.</param>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="objectType">The object type.</param>
        /// <param name="objectPlacement">The local placement.</param>
        /// <param name="representation">The geometric representation of the entity, in the IfcProductRepresentation.</param>
        /// <param name="elementTag">The tag for the identifier of the element.</param>
        /// <param name="predefinedType">The pile type.</param>
        /// <param name="constructionType">The optional material for the construction of the pile.</param>
        /// <returns>The handle.</returns>
        public static IFCAnyHandle CreatePile(IFCFile file, string guid, IFCAnyHandle ownerHistory,
            string name, string description, string objectType, IFCAnyHandle objectPlacement,
            IFCAnyHandle representation, string elementTag, IFCPileType predefinedType, IFCPileConstructionEnum? constructionType)
        {
            ValidateElement(guid, ownerHistory, name, description, objectType, objectPlacement, representation, elementTag);

            IFCAnyHandle pile = CreateInstance(file, IFCEntityType.IfcPile);
            IFCAnyHandleUtil.SetAttribute(pile, "PredefinedType", predefinedType);
            IFCAnyHandleUtil.SetAttribute(pile, "ConstructionType", constructionType);
            SetElement(pile, guid, ownerHistory, name, description, objectType, objectPlacement, representation, elementTag);
            return pile;
        }