public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _totalCrossSectionArea = value.RealVal;
                break;

            case 1:
                _steelGrade = value.StringVal;
                break;

            case 2:
                _barSurface =
                    (IfcReinforcingBarSurfaceEnum)
                    Enum.Parse(typeof(IfcReinforcingBarSurfaceEnum), value.EnumVal, true);
                break;

            case 3:
                _effectiveDepth = value.RealVal;
                break;

            case 4:
                _nominalBarDiameter = value.RealVal;
                break;

            case 5:
                _barCount = value.NumberVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _totalCrossSectionArea = value.RealVal;
                return;

            case 1:
                _steelGrade = value.StringVal;
                return;

            case 2:
                _barSurface = (IfcReinforcingBarSurfaceEnum)System.Enum.Parse(typeof(IfcReinforcingBarSurfaceEnum), value.EnumVal, true);
                return;

            case 3:
                _effectiveDepth = value.RealVal;
                return;

            case 4:
                _nominalBarDiameter = value.RealVal;
                return;

            case 5:
                _barCount = value.NumberVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the Gross Floor Area, if the element base quantity GrossFloorArea is defined this has precedence
        /// If no property is defined the GFA is returned as the sume of the building storeys GFA
        /// </summary>
        /// <param name="building"></param>
        /// <returns></returns>
        public static IfcAreaMeasure?GetGrossFloorArea(this IfcBuilding building)
        {
            IfcQuantityArea qArea = building.GetQuantity <IfcQuantityArea>("BaseQuantities", "GrossFloorArea");

            if (qArea == null)
            {
                qArea = building.GetQuantity <IfcQuantityArea>("GrossFloorArea");               //just look for any area
            }
            if (qArea != null)
            {
                return(qArea.AreaValue);
            }
            IfcAreaMeasure area = 0;

            foreach (IfcBuildingStorey buildingStorey in building.GetBuildingStoreys())
            {
                IfcAreaMeasure?bsArea = buildingStorey.GetGrossFloorArea();
                if (bsArea.HasValue)
                {
                    area += bsArea;
                }
            }
            if (area != 0)
            {
                return(area);
            }
            return(null);
        }
Ejemplo n.º 4
0
 public IfcReinforcementBarProperties(IfcAreaMeasure __TotalCrossSectionArea, IfcLabel __SteelGrade, IfcReinforcingBarSurfaceEnum?__BarSurface, IfcLengthMeasure?__EffectiveDepth, IfcPositiveLengthMeasure?__NominalBarDiameter, IfcCountMeasure?__BarCount)
 {
     this.TotalCrossSectionArea = __TotalCrossSectionArea;
     this.SteelGrade            = __SteelGrade;
     this.BarSurface            = __BarSurface;
     this.EffectiveDepth        = __EffectiveDepth;
     this.NominalBarDiameter    = __NominalBarDiameter;
     this.BarCount = __BarCount;
 }
Ejemplo n.º 5
0
 public IfcReinforcingBar(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcLabel?__ObjectType, IfcObjectPlacement __ObjectPlacement, IfcProductRepresentation __Representation, IfcIdentifier?__Tag, IfcLabel?__SteelGrade, IfcPositiveLengthMeasure __NominalDiameter, IfcAreaMeasure __CrossSectionArea, IfcPositiveLengthMeasure?__BarLength, IfcReinforcingBarRoleEnum __BarRole, IfcReinforcingBarSurfaceEnum?__BarSurface)
     : base(__GlobalId, __OwnerHistory, __Name, __Description, __ObjectType, __ObjectPlacement, __Representation, __Tag, __SteelGrade)
 {
     this._NominalDiameter  = __NominalDiameter;
     this._CrossSectionArea = __CrossSectionArea;
     this._BarLength        = __BarLength;
     this._BarRole          = __BarRole;
     this._BarSurface       = __BarSurface;
 }
Ejemplo n.º 6
0
 public IfcSpaceProgram(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcLabel?__ObjectType, IfcIdentifier __SpaceProgramIdentifier, IfcAreaMeasure?__MaxRequiredArea, IfcAreaMeasure?__MinRequiredArea, IfcSpatialStructureElement __RequestedLocation, IfcAreaMeasure __StandardRequiredArea)
     : base(__GlobalId, __OwnerHistory, __Name, __Description, __ObjectType)
 {
     this._SpaceProgramIdentifier = __SpaceProgramIdentifier;
     this._MaxRequiredArea        = __MaxRequiredArea;
     this._MinRequiredArea        = __MinRequiredArea;
     this._RequestedLocation      = __RequestedLocation;
     this._StandardRequiredArea   = __StandardRequiredArea;
 }
Ejemplo n.º 7
0
        internal IfcQuantityAreaTransient(MeasureResource.IfcMeasureWithUnit measure)
        {
            var value = measure.ValueComponent;

            _unit = measure.UnitComponent as Ifc4.Interfaces.IIfcNamedUnit;
            if (!(value is MeasureResource.IfcAreaMeasure))
            {
                return;
            }
            _areaValue = new IfcAreaMeasure((MeasureResource.IfcAreaMeasure)value);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Get Net Area value
        /// </summary>
        /// <param name="ifcSpace">IfcSpace object</param>
        /// <param name="allPropertyValues">COBieDataPropertySetValues object holds all the properties for all the IfcSpace</param>
        /// <returns>property value as string or default value</returns>
        private string GetNetArea(IfcSpace ifcSpace, COBieDataPropertySetValues allPropertyValues)
        {
            string areaUnit  = null;
            double areavalue = 0.0;

            if (!string.IsNullOrEmpty(Context.WorkBookUnits.AreaUnit))
            {
                areaUnit = Context.WorkBookUnits.AreaUnit;            //see what the global area unit is
            }
            IfcAreaMeasure netAreaValue = ifcSpace.GetNetFloorArea(); //this extension has the GSA built in so no need to get again

            if (netAreaValue != null)
            {
                areavalue = ((double)netAreaValue);
                if (areavalue > 0.0)
                {
                    //if ((!string.IsNullOrEmpty(areaUnit)) && (areaUnit.ToLower().Contains("milli")) && (areavalue > 250000.0)) //we are using millimetres, and areavalue is lightly to be in mmsq if over 250000(0.5msq)
                    //    areavalue = areavalue / 1000000.0;

                    return(areavalue.ToString("F4"));
                }
            }

            //Fall back to properties
            //get the property single values for this ifcSpace
            if (allPropertyValues.CurrentObject != ifcSpace)
            {
                allPropertyValues.SetAllPropertyValues(ifcSpace);
            }


            //try and find it in the attached properties of the ifcSpace
            string value = allPropertyValues.GetPropertySingleValueValue("NetFloorArea", true);

            if (value == DEFAULT_STRING)
            {
                value = allPropertyValues.GetPropertySingleValueValue("GSA", true);
            }

            if (value == DEFAULT_STRING)
            {
                return(DEFAULT_NUMERIC);
            }
            else
            {
                if (double.TryParse(value, out areavalue))
                {
                    //if ((!string.IsNullOrEmpty(areaUnit)) && (areaUnit.ToLower().Contains("milli")) && (areavalue > 250000.0))//we are using millimetres, and areavalue is lightly to be in mmsq if over 250000(0.5msq)
                    //    areavalue = areavalue / 1000000.0;
                    return(areavalue.ToString("F4"));
                }
                return(value);
            }
        }
Ejemplo n.º 9
0
 public IfcReinforcingMesh(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcLabel?__ObjectType, IfcObjectPlacement __ObjectPlacement, IfcProductRepresentation __Representation, IfcIdentifier?__Tag, IfcLabel?__SteelGrade, IfcPositiveLengthMeasure?__MeshLength, IfcPositiveLengthMeasure?__MeshWidth, IfcPositiveLengthMeasure __LongitudinalBarNominalDiameter, IfcPositiveLengthMeasure __TransverseBarNominalDiameter, IfcAreaMeasure __LongitudinalBarCrossSectionArea, IfcAreaMeasure __TransverseBarCrossSectionArea, IfcPositiveLengthMeasure __LongitudinalBarSpacing, IfcPositiveLengthMeasure __TransverseBarSpacing)
     : base(__GlobalId, __OwnerHistory, __Name, __Description, __ObjectType, __ObjectPlacement, __Representation, __Tag, __SteelGrade)
 {
     this._MeshLength = __MeshLength;
     this._MeshWidth  = __MeshWidth;
     this._LongitudinalBarNominalDiameter  = __LongitudinalBarNominalDiameter;
     this._TransverseBarNominalDiameter    = __TransverseBarNominalDiameter;
     this._LongitudinalBarCrossSectionArea = __LongitudinalBarCrossSectionArea;
     this._TransverseBarCrossSectionArea   = __TransverseBarCrossSectionArea;
     this._LongitudinalBarSpacing          = __LongitudinalBarSpacing;
     this._TransverseBarSpacing            = __TransverseBarSpacing;
 }
Ejemplo n.º 10
0
 public IfcTendon(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcLabel?__ObjectType, IfcObjectPlacement __ObjectPlacement, IfcProductRepresentation __Representation, IfcIdentifier?__Tag, IfcLabel?__SteelGrade, IfcTendonTypeEnum __PredefinedType, IfcPositiveLengthMeasure __NominalDiameter, IfcAreaMeasure __CrossSectionArea, IfcForceMeasure?__TensionForce, IfcPressureMeasure?__PreStress, IfcNormalisedRatioMeasure?__FrictionCoefficient, IfcPositiveLengthMeasure?__AnchorageSlip, IfcPositiveLengthMeasure?__MinCurvatureRadius)
     : base(__GlobalId, __OwnerHistory, __Name, __Description, __ObjectType, __ObjectPlacement, __Representation, __Tag, __SteelGrade)
 {
     this._PredefinedType      = __PredefinedType;
     this._NominalDiameter     = __NominalDiameter;
     this._CrossSectionArea    = __CrossSectionArea;
     this._TensionForce        = __TensionForce;
     this._PreStress           = __PreStress;
     this._FrictionCoefficient = __FrictionCoefficient;
     this._AnchorageSlip       = __AnchorageSlip;
     this._MinCurvatureRadius  = __MinCurvatureRadius;
 }
Ejemplo n.º 11
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 9:
                _predefinedType = (IfcTendonTypeEnum)System.Enum.Parse(typeof(IfcTendonTypeEnum), value.EnumVal, true);
                return;

            case 10:
                _nominalDiameter = value.RealVal;
                return;

            case 11:
                _crossSectionArea = value.RealVal;
                return;

            case 12:
                _tensionForce = value.RealVal;
                return;

            case 13:
                _preStress = value.RealVal;
                return;

            case 14:
                _frictionCoefficient = value.RealVal;
                return;

            case 15:
                _anchorageSlip = value.RealVal;
                return;

            case 16:
                _minCurvatureRadius = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 12
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 9:
                _meshLength = value.RealVal;
                return;

            case 10:
                _meshWidth = value.RealVal;
                return;

            case 11:
                _longitudinalBarNominalDiameter = value.RealVal;
                return;

            case 12:
                _transverseBarNominalDiameter = value.RealVal;
                return;

            case 13:
                _longitudinalBarCrossSectionArea = value.RealVal;
                return;

            case 14:
                _transverseBarCrossSectionArea = value.RealVal;
                return;

            case 15:
                _longitudinalBarSpacing = value.RealVal;
                return;

            case 16:
                _transverseBarSpacing = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 13
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
                base.IfcParse(propIndex, value);
                break;

            case 9:
                _meshLength = value.RealVal;
                break;

            case 10:
                _meshWidth = value.RealVal;
                break;

            case 11:
                _longitudinalBarNominalDiameter = value.RealVal;
                break;

            case 12:
                _transverseBarNominalDiameter = value.RealVal;
                break;

            case 13:
                _longitudinalBarCrossSectionArea = value.RealVal;
                break;

            case 14:
                _transverseBarCrossSectionArea = value.RealVal;
                break;

            case 15:
                _longitudinalBarSpacing = value.RealVal;
                break;

            case 16:
                _transverseBarSpacing = value.RealVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 14
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
                base.IfcParse(propIndex, value);
                break;

            case 9:
                _predefinedType = (IfcTendonTypeEnum)Enum.Parse(typeof(IfcTendonTypeEnum), value.EnumVal, true);
                break;

            case 10:
                _nominalDiameter = value.RealVal;
                break;

            case 11:
                _crossSectionArea = value.RealVal;
                break;

            case 12:
                _tensionForce = value.RealVal;
                break;

            case 13:
                _preStress = value.RealVal;
                break;

            case 14:
                _frictionCoefficient = value.RealVal;
                break;

            case 15:
                _anchorageSlip = value.RealVal;
                break;

            case 16:
                _minCurvatureRadius = value.RealVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 15
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 3:
                _areaValue = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 16
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
                base.IfcParse(propIndex, value);
                break;

            case 3:
                _areaValue = value.RealVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 17
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
                base.IfcParse(propIndex, value);
                break;

            case 9:
                _nominalDiameter = value.RealVal;
                break;

            case 10:
                _crossSectionArea = value.RealVal;
                break;

            case 11:
                _barLength = value.RealVal;
                break;

            case 12:
                _barRole =
                    (IfcReinforcingBarRoleEnum)
                    Enum.Parse(typeof(IfcReinforcingBarRoleEnum), value.EnumVal, true);
                break;

            case 13:
                _barSurface =
                    (IfcReinforcingBarSurfaceEnum)
                    Enum.Parse(typeof(IfcReinforcingBarSurfaceEnum), value.EnumVal, true);
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 18
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 9:
                _nominalDiameter = value.RealVal;
                return;

            case 10:
                _crossSectionArea = value.RealVal;
                return;

            case 11:
                _barLength = value.RealVal;
                return;

            case 12:
                _barRole = (IfcReinforcingBarRoleEnum)System.Enum.Parse(typeof(IfcReinforcingBarRoleEnum), value.EnumVal, true);
                return;

            case 13:
                _barSurface = (IfcReinforcingBarSurfaceEnum)System.Enum.Parse(typeof(IfcReinforcingBarSurfaceEnum), value.EnumVal, true);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Returns the projected footprint are of the site, this value is derived and makes use of property sets not in the ifc schema
        /// </summary>
        /// <param name="site"></param>
        /// <returns></returns>
        public static IfcAreaMeasure?GetFootprintArea(this IfcSite site)
        {
            IfcQuantityArea qArea = site.GetQuantity <IfcQuantityArea>("BaseQuantities", "GrossArea");

            if (qArea == null)
            {
                qArea = site.GetQuantity <IfcQuantityArea>("GrossArea");              //just look for any area
            }
            if (qArea != null)
            {
                return(qArea.AreaValue);
            }
            //if revit try their value
            IfcAreaMeasure val = site.GetPropertySingleValue <IfcAreaMeasure>("PSet_Revit_Dimensions", "Projected Area");

            if (val != null)
            {
                return(val);
            }

            return(null);
        }
Ejemplo n.º 20
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 5:
                _spaceProgramIdentifier = value.StringVal;
                return;

            case 6:
                _maxRequiredArea = value.RealVal;
                return;

            case 7:
                _minRequiredArea = value.RealVal;
                return;

            case 8:
                _requestedLocation = (IfcSpatialStructureElement)(value.EntityVal);
                return;

            case 9:
                _standardRequiredArea = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 21
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                base.IfcParse(propIndex, value);
                break;

            case 5:
                _SpaceProgramIdentifier = value.StringVal;
                break;

            case 6:
                _MaxRequiredArea = value.RealVal;
                break;

            case 7:
                _MinRequiredArea = value.RealVal;
                break;

            case 8:
                _RequestedLocation = (IfcSpatialStructureElement)value.EntityVal;
                break;

            case 9:
                _StandardRequiredArea = value.RealVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Get space gross floor area
        /// </summary>
        /// <param name="ifcSpace">IfcSpace object</param>
        /// <param name="allPropertyValues">COBieDataPropertySetValues object holds all the properties for all the IfcSpace</param>
        /// <returns>property value as string or default value</returns>
        private string GetGrossFloorArea(IfcSpace ifcSpace, COBieDataPropertySetValues allPropertyValues)
        {
            string areaUnit  = null;
            double areavalue = 0.0;

            if (!string.IsNullOrEmpty(Context.WorkBookUnits.AreaUnit))
            {
                areaUnit = Context.WorkBookUnits.AreaUnit;//see what the global area unit is
            }
            //Do Gross Areas
            IfcAreaMeasure grossAreaValue = ifcSpace.GetGrossFloorArea();

            if (grossAreaValue != null)
            {
                areavalue = ((double)grossAreaValue);
            }
            else//if we fail on IfcAreaMeasure try GSA keys
            {
                IfcQuantityArea spArea = ifcSpace.GetQuantity <IfcQuantityArea>("GSA Space Areas", "GSA BIM Area");
                if ((spArea is IfcQuantityArea) && (spArea.AreaValue != null))
                {
                    areavalue = ((double)spArea.AreaValue);
                }
            }
            if (areavalue > 0.0)
            {
                //if ((!string.IsNullOrEmpty(areaUnit)) && (areaUnit.ToLower().Contains("milli")) && (areavalue > 250000.0)) //we are using millimetres, and areavalue is lightly to be in mmsq if over 250000(0.5msq)
                //    areavalue = areavalue / 1000000.0;

                return(areavalue.ToString("F4"));
            }

            //Fall back to properties
            //get the property single values for this ifcSpace
            if (allPropertyValues.CurrentObject != ifcSpace)
            {
                allPropertyValues.SetAllPropertyValues(ifcSpace);
            }

            //try and find it in the attached properties of the ifcSpace
            string value = allPropertyValues.GetPropertySingleValueValue("GrossFloorArea", true);

            if (value == DEFAULT_STRING)
            {
                value = allPropertyValues.GetPropertySingleValueValue("GSA", true);
            }

            if (value == DEFAULT_STRING)
            {
                return(DEFAULT_NUMERIC);
            }
            else
            {
                if (double.TryParse(value, out areavalue))
                {
                    //if ((!string.IsNullOrEmpty(areaUnit)) && (areaUnit.ToLower().Contains("milli")) && (areavalue > 250000.0))//we are using millimetres, and areavalue is lightly to be in mmsq if over 250000(0.5msq)
                    //    areavalue = areavalue / 1000000.0;
                    return(areavalue.ToString("F4"));
                }
                return(value);
            }
        }
Ejemplo n.º 23
0
 public IfcQuantityArea(IfcLabel __Name, IfcText?__Description, IfcNamedUnit __Unit, IfcAreaMeasure __AreaValue, IfcLabel?__Formula)
     : base(__Name, __Description, __Unit)
 {
     this._AreaValue = __AreaValue;
     this._Formula   = __Formula;
 }