/// <summary>
 /// Allow for override of IfcObjectDefinition shared parameter names.
 /// </summary>
 /// <param name="name">The enum corresponding of the shared parameter.</param>
 /// <returns>The name appropriate for this IfcObjectDefinition.</returns>
 public override string GetSharedParameterName(IFCSharedParameters name)
 {
    switch (name)
    {
       case IFCSharedParameters.IfcName:
          return "IfcBuilding Name";
       case IFCSharedParameters.IfcDescription:
          return "IfcBuilding Description";
       default:
          return base.GetSharedParameterName(name);
    }
 }
Exemple #2
0
        /// <summary>
        /// Allow for override of IfcObjectDefinition shared parameter names.
        /// </summary>
        /// <param name="name">The enum corresponding of the shared parameter.</param>
        /// <returns>The name appropriate for this IfcObjectDefinition.</returns>
        public override string GetSharedParameterName(IFCSharedParameters name)
        {
            switch (name)
            {
            case IFCSharedParameters.IfcName:
                return("IfcBuilding Name");

            case IFCSharedParameters.IfcDescription:
                return("IfcBuilding Description");

            default:
                return(base.GetSharedParameterName(name));
            }
        }
Exemple #3
0
        /// <summary>
        /// Allow for override of IfcObjectDefinition shared parameter names.
        /// </summary>
        /// <param name="name">The enum corresponding of the shared parameter.</param>
        /// <param name="isType">True if the shared parameter is a type parameter.</param>
        /// <returns>The name appropriate for this IfcObjectDefinition.</returns>
        public override string GetSharedParameterName(IFCSharedParameters name, bool isType)
        {
            if (!isType)
            {
                switch (name)
                {
                case IFCSharedParameters.IfcName:
                    return("BuildingName");

                case IFCSharedParameters.IfcDescription:
                    return("BuildingDescription");
                }
            }

            return(base.GetSharedParameterName(name, isType));
        }
 /// <summary>
 /// Allow for override of IfcObjectDefinition shared parameter names.
 /// </summary>
 /// <param name="name">The enum corresponding of the shared parameter.</param>
 /// <returns>The name appropriate for this IfcObjectDefinition.</returns>
 public virtual string GetSharedParameterName(IFCSharedParameters name)
 {
    return name.ToString();
 }
        /// <summary>
        /// Add a string parameter to an element.
        /// </summary>
        /// <param name="doc">The document.</param>
        /// <param name="element">The element.</param>
        /// <param name="objDef">The IFCObjectDefinition that created the element.</param>
        /// <param name="name">The enum corresponding to the parameter name.</param>
        /// <param name="parameterValue">The parameter value.</param>
        /// <param name="parameterSetId">The id of the containing parameter set, for reporting errors.</param>
        /// <returns>True if the parameter was successfully added, false otherwise.</returns>
        public static bool AddParameterString(Document doc, Element element, IFCObjectDefinition objDef, IFCSharedParameters name, string parameterValue, int parameterSetId)
        {
            if (objDef == null)
            {
                return(false);
            }

            string parameterName = objDef.GetSharedParameterName(name);

            Parameter parameter = AddParameterBase(doc, element, parameterName, parameterSetId, ParameterType.Text);

            if (parameter == null)
            {
                return(false);
            }

            parameter.Set(parameterValue);
            return(true);
        }
        /// <summary>
        /// Add a string parameter to an element.
        /// </summary>
        /// <param name="doc">The document.</param>
        /// <param name="element">The element.</param>
        /// <param name="objDef">The IFCObjectDefinition that created the element.</param>
        /// <param name="name">The enum corresponding to the parameter name.</param>
        /// <param name="parameterValue">The parameter value.</param>
        /// <param name="parameterSetId">The id of the containing parameter set, for reporting errors.</param>
        /// <returns>True if the parameter was successfully added, false otherwise.</returns>
        public static bool AddParameterString(Document doc, Element element, IFCObjectDefinition objDef, IFCSharedParameters name, string parameterValue, int parameterSetId)
        {
            if (objDef == null)
                return false;

            string parameterName = objDef.GetSharedParameterName(name);

            Parameter parameter = AddParameterBase(doc, element, parameterName, parameterSetId, ParameterType.Text);
            if (parameter == null)
                return false;

            parameter.Set(parameterValue);
            return true;
        }
Exemple #7
0
 /// <summary>
 /// Allow for override of IfcObjectDefinition shared parameter names.
 /// </summary>
 /// <param name="name">The enum corresponding of the shared parameter.</param>
 /// <returns>The name appropriate for this IfcObjectDefinition.</returns>
 public virtual string GetSharedParameterName(IFCSharedParameters name)
 {
     return(name.ToString());
 }
 /// <summary>
 /// Allow for override of IfcObjectDefinition shared parameter names.
 /// </summary>
 /// <param name="name">The enum corresponding of the shared parameter.</param>
 /// <param name="isType">True if the shared parameter is a type parameter.</param>
 /// <returns>The name appropriate for this IfcObjectDefinition.</returns>
 public virtual string GetSharedParameterName(IFCSharedParameters name, bool isType)
 {
     return(name.ToString() + (isType ? " [Type]" : ""));
 }
Exemple #9
0
        /// <summary>
        /// Add a string parameter to an element.
        /// </summary>
        /// <param name="doc">The document.</param>
        /// <param name="element">The element.</param>
        /// <param name="category">The category of the element.</param>
        /// <param name="objDef">The IFCObjectDefinition that created the element.</param>
        /// <param name="name">The enum corresponding to the parameter name.</param>
        /// <param name="parameterValue">The parameter value.</param>
        /// <param name="parameterSetId">The id of the containing parameter set, for reporting errors.</param>
        /// <returns>True if the parameter was successfully added, false otherwise.</returns>
        public static bool AddParameterString(Document doc, Element element, Category category, IFCObjectDefinition objDef, IFCSharedParameters name, string parameterValue, int parameterSetId)
        {
            if (doc == null || element == null || category == null || objDef == null)
            {
                return(false);
            }

            string parameterName = objDef.GetSharedParameterName(name, element is ElementType);

            bool?processedParameter = Importer.TheProcessor.ProcessParameter(objDef.Id, parameterSetId, parameterName, parameterValue);

            if (processedParameter.HasValue)
            {
                return(processedParameter.Value);
            }

            Parameter parameter = AddParameterBase(doc, element, category, parameterName, parameterSetId, SpecTypeId.String.Text);

            if (parameter == null)
            {
                return(false);
            }

            parameter.Set(parameterValue);
            return(true);
        }