/// <summary>
 /// Creates a handle representing an IfcSIUnit and assigns it to the file.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="unitType">The type of the unit.</param>
 /// <param name="prefix">The SI Prefix for defining decimal multiples and submultiples of the unit.</param>
 /// <param name="name">The word, or group of words, by which the SI unit is referred to.</param>
 /// <returns>The handle.</returns>
 public static IFCAnyHandle CreateSIUnit(IFCFile file, IFCUnit unitType, IFCSIPrefix? prefix,
     IFCSIUnitName name)
 {
    IFCAnyHandle siUnit = CreateInstance(file, IFCEntityType.IfcSIUnit);
    IFCAnyHandleUtil.SetAttribute(siUnit, "Prefix", prefix);
    IFCAnyHandleUtil.SetAttribute(siUnit, "Name", name);
    SetNamedUnit(siUnit, null, unitType);
    return siUnit;
 }
Ejemplo n.º 2
0
        private IFCAnyHandle CreateSIUnit(IFCFile file, UnitType? unitType, IFCUnit ifcUnitType, IFCSIUnitName unitName, IFCSIPrefix? prefix, DisplayUnitType? dut)
        {
            IFCAnyHandle siUnit = IFCInstanceExporter.CreateSIUnit(file, ifcUnitType, prefix, unitName);
            if (unitType.HasValue && dut.HasValue)
            {
                double scaleFactor = UnitUtils.ConvertFromInternalUnits(1.0, dut.Value);
                ExporterCacheManager.UnitsCache.AddUnit(unitType.Value, siUnit, scaleFactor, 0.0);
            }

            return siUnit;
        }
Ejemplo n.º 3
0
 private IFCAnyHandle CreateSIUnit(IFCFile file, IFCUnit ifcUnitType, IFCSIUnitName unitName, IFCSIPrefix? prefix)
 {
     IFCAnyHandle siUnit = IFCInstanceExporter.CreateSIUnit(file, ifcUnitType, prefix, unitName);
     return siUnit;
 }