/// <summary>
        /// Finds the value of a optional length attribute.
        /// </summary>
        /// <param name="handle">The entity handle.</param>
        /// <param name="name">The name of the atribute.</param>
        /// <param name="defaultValue">The default value, if not found.</param>
        /// <returns>The length value, scaled.</returns>
        /// <remarks>defaultValue should be scaled.</remarks>
        static public double GetOptionalScaledLengthAttribute(IFCAnyHandle handle, string name, double defaultValue)
        {
            double?value = IFCAnyHandleUtil.GetDoubleAttribute(handle, name);

            if (value.HasValue)
            {
                return(IFCUnitUtil.ScaleLength(value.Value));
            }

            return(defaultValue);
        }
        /// <summary>
        /// Finds the value of a required angle attribute.
        /// </summary>
        /// <param name="handle">The entity handle.</param>
        /// <param name="name">The name of the atribute.</param>
        /// <param name="found">Returns true if the angle was found.</param>
        /// <returns>The angle, scaled.</returns>
        static public double GetRequiredScaledAngleAttribute(IFCAnyHandle handle, string name, out bool found)
        {
            double?value = IFCAnyHandleUtil.GetDoubleAttribute(handle, name);

            if (value.HasValue)
            {
                found = true;
                return(IFCUnitUtil.ScaleAngle(value.Value));
            }

            found = false;
            return(0.0);
        }
        /// <summary>
        /// Finds the value of a required length attribute.
        /// </summary>
        /// <param name="handle">The entity handle.</param>
        /// <param name="name">The name of the atribute.</param>
        /// <param name="found">True if it was found, false if not.</param>
        /// <returns>The length value, scaled.</returns>
        static public double GetRequiredScaledLengthAttribute(IFCAnyHandle handle, string name, out bool found)
        {
            double?value = IFCAnyHandleUtil.GetDoubleAttribute(handle, name);

            if (value.HasValue)
            {
                found = true;
                return(IFCUnitUtil.ScaleLength(value.Value));
            }

            Importer.TheLog.LogMissingRequiredAttributeError(handle, name, false);
            found = false;
            return(0.0);
        }
Esempio n. 4
0
 /// <summary>
 /// Converts values from default unit to the project unit for the active IFCProject.
 /// </summary>
 /// <param name="unitType">The unit type.</param>
 /// <param name="inValues">The value to convert.</param>
 static public void ScaleValues(UnitType unitType, IList <XYZ> inValues)
 {
     IFCUnitUtil.ProjectScale(unitType, inValues);
 }
Esempio n. 5
0
 /// <summary>
 /// Converts a value from default unit to the project unit for the active IFCProject.
 /// </summary>
 /// <param name="unitType">The unit type.</param>
 /// <param name="inValue">The value to convert.</param>
 /// <returns>The result value.</returns>
 static public XYZ ScaleValue(UnitType unitType, XYZ inValue)
 {
     return(IFCUnitUtil.ProjectScale(unitType, inValue));
 }
Esempio n. 6
0
 /// <summary>
 /// Converts a value from default unit to the project unit for the active IFCProject.
 /// </summary>
 /// <param name="unitType">The unit type.</param>
 /// <param name="inValue">The value to convert.</param>
 /// <returns>The result value.</returns>
 static public double ScaleValue(UnitType unitType, double inValue)
 {
     return(IFCUnitUtil.ProjectScale(unitType, inValue));
 }