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:
                _startDistAlong = value.RealVal;
                return;

            case 4:
                _horizontalLength = value.RealVal;
                return;

            case 5:
                _startHeight = value.RealVal;
                return;

            case 6:
                _startGradient = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
 public IfcAlignment2DVerticalSegment(IfcBoolean?__TangentialContinuity, IfcLabel?__StartTag, IfcLabel?__EndTag, IfcLengthMeasure __StartDistAlong, IfcPositiveLengthMeasure __HorizontalLength, IfcLengthMeasure __StartHeight, IfcRatioMeasure __StartGradient)
     : base(__TangentialContinuity, __StartTag, __EndTag)
 {
     this._StartDistAlong   = __StartDistAlong;
     this._HorizontalLength = __HorizontalLength;
     this._StartHeight      = __StartHeight;
     this._StartGradient    = __StartGradient;
 }
Example #3
0
        private static void ProcessItems(CostModel model, List <TPolozka> polozky, CostItem parent, Dictionary <string, ClassificationItem> map)
        {
            if (polozky == null)
            {
                return;
            }
            foreach (var polozka in polozky)
            {
                var item = new CostItem(model)
                {
                    Name        = polozka.Nazev,
                    Identifier  = polozka.Cislo,
                    Description = polozka.PPOPIS,
                    Type        = polozka.Typ.ToString()
                };

                // unit cost. There might be more than one or it can be modeled as a hierarchy with operators
                var unitCost = new CostValue(model)
                {
                    Value = System.Convert.ToDouble(polozka.JCena)
                };
                // in the base case there is just one
                item.UnitValues.Add(unitCost);

                // Quantities have measure type and unit, if it is not cost
                AddQuantity(model, item, polozka.MJ, System.Convert.ToDouble(polozka.Mnozstvi));

                // additional properties can be stored in custom property sets
                item["CZ_CostItem"] = new PropertySet(model);
                item["CZ_CostItem"]["JHmotnost"]           = new IfcMassMeasure(System.Convert.ToDouble(polozka.JHmotnost));
                item["CZ_CostItem"]["JDemontazniHmotnost"] = new IfcMassMeasure(System.Convert.ToDouble(polozka.JDemontazniHmotnost));
                item["CZ_CostItem"]["SazbaDPH"]            = new IfcRatioMeasure(System.Convert.ToDouble(polozka.SazbaDPH) / 100);
                item["CZ_CostItem"]["ObchNazev"]           = new IfcIdentifier(polozka.ObchNazev);
                item["CZ_CostItem"]["ObchNazevAN"]         = new IfcBoolean(polozka.ObchNazevAN);
                item["CZ_CostItem"]["PoradoveCislo"]       = new IfcInteger(polozka.PoradoveCislo);
                parent.Children.Add(item);

                // Deprecated: using IFC GlobalId
                // item["CZ_CostItem"]["UID"] = new IfcIdentifier(polozka.UID);

                // assign classification item if defined
                if (
                    !string.IsNullOrWhiteSpace(polozka.PolozkaZatrideniUID) &&
                    map.TryGetValue(polozka.PolozkaZatrideniUID, out ClassificationItem ci))
                {
                    item.ClassificationItems.Add(ci);
                }
            }
        }
Example #4
0
 private static void SetConversionUnitsParameters(IModel model, IfcConversionBasedUnit unit, IfcLabel name,
                                                  IfcRatioMeasure ratio, IfcUnitEnum unitType, IfcSIUnitName siUnitName,
                                                  IfcSIPrefix?siUnitPrefix, IfcDimensionalExponents dimensions)
 {
     unit.Name             = name;
     unit.ConversionFactor = model.Instances.New <IfcMeasureWithUnit>();
     unit.ConversionFactor.ValueComponent = ratio;
     unit.ConversionFactor.UnitComponent  = model.Instances.New <IfcSIUnit>(s =>
     {
         s.UnitType = unitType;
         s.Name     = siUnitName;
         s.Prefix   = siUnitPrefix;
     });
     unit.Dimensions = dimensions;
 }
        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:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 7:
                _factor = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
        public static string GetAsString(this IfcAppliedValue ifcAppliedValue)
        {
            StringBuilder value = new StringBuilder();

            if ((ifcAppliedValue.Description.HasValue) &&
                (!string.IsNullOrEmpty(ifcAppliedValue.Description))
                )
            {
                value.Append(ifcAppliedValue.Description);
                value.Append(", ");
            }

            if (ifcAppliedValue.Value != null)//not nullable should be? incorrect name?
            {
                value.Append("AppliedValue: ");
                if (ifcAppliedValue.Value is IfcRatioMeasure)
                {
                    IfcRatioMeasure ifcRatioMeasure = (IfcRatioMeasure)ifcAppliedValue.Value;
                    value.Append(string.Format("{0,0:N2}", ifcRatioMeasure.Value));
                }
                if (ifcAppliedValue.Value is IfcMonetaryMeasure)
                {
                    IfcMonetaryMeasure ifcMonetaryMeasure = (IfcMonetaryMeasure)ifcAppliedValue.Value;
                    value.Append(string.Format("{0,0:N2}", ifcMonetaryMeasure.Value));
                }
                if (ifcAppliedValue.Value is IfcMeasureWithUnit)
                {
                    value.Append(GetMeasureWithUnitAsString((IfcMeasureWithUnit)ifcAppliedValue.Value));
                }
                value.Append(", ");
            }

            if (ifcAppliedValue.UnitBasis != null) //not nullable should be?
            {
                value.Append("UnitBase: ");
                value.Append(GetMeasureWithUnitAsString((IfcMeasureWithUnit)ifcAppliedValue.UnitBasis));
                value.Append(", ");
            }
            if (ifcAppliedValue.ApplicableDate != null) //not nullable should be?
            {
                value.Append("ApplicableDate: ");
                value.Append(ifcAppliedValue.ApplicableDate.GetAsString());
                value.Append(", ");
            }
            if (ifcAppliedValue.FixedUntilDate != null) //not nullable should be?
            {
                value.Append("FixedUntilDate: ");
                value.Append(ifcAppliedValue.FixedUntilDate.GetAsString());
                value.Append(", ");
            }

            if (ifcAppliedValue is IfcCostValue)
            {
                IfcCostValue ifcCostValue = (IfcCostValue)ifcAppliedValue;
                if (ifcCostValue.CostType != null)
                {
                    value.Append("CostType: ");
                    value.Append(ifcCostValue.CostType);
                    value.Append(", ");
                }

                if (ifcCostValue.Condition != null)//not nullable should be?
                {
                    value.Append("Condition: ");
                    value.Append(ifcCostValue.Condition);
                    value.Append(", ");
                }
            }
            if (ifcAppliedValue is IfcEnvironmentalImpactValue)
            {
                IfcEnvironmentalImpactValue ifcEnvironmentalImpactValue = (IfcEnvironmentalImpactValue)ifcAppliedValue;
                if (ifcEnvironmentalImpactValue.ImpactType != null)
                {
                    value.Append("ImpactType: ");
                    value.Append(ifcEnvironmentalImpactValue.ImpactType);
                    value.Append(", ");
                }

                //enum so should have a value as not nullable
                value.Append("Category: ");
                value.Append(ifcEnvironmentalImpactValue.Category.ToString());
                value.Append(", ");

                if (ifcEnvironmentalImpactValue.UserDefinedCategory != null)//not nullable should be?
                {
                    value.Append("UserDefinedCategory: ");
                    value.Append(ifcEnvironmentalImpactValue.UserDefinedCategory);
                    value.Append(", ");
                }
            }
            return(value.ToString());
        }
Example #7
0
 public IfcAlignment2DVerSegCircularArc(IfcBoolean?__TangentialContinuity, IfcLabel?__StartTag, IfcLabel?__EndTag, IfcLengthMeasure __StartDistAlong, IfcPositiveLengthMeasure __HorizontalLength, IfcLengthMeasure __StartHeight, IfcRatioMeasure __StartGradient, IfcPositiveLengthMeasure __Radius, IfcBoolean __IsConvex)
     : base(__TangentialContinuity, __StartTag, __EndTag, __StartDistAlong, __HorizontalLength, __StartHeight, __StartGradient)
 {
     this.Radius   = __Radius;
     this.IsConvex = __IsConvex;
 }
 public IfcRelAssignsToGroupByFactor(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcObjectDefinition[] __RelatedObjects, IfcObjectTypeEnum?__RelatedObjectsType, IfcGroup __RelatingGroup, IfcRatioMeasure __Factor)
     : base(__GlobalId, __OwnerHistory, __Name, __Description, __RelatedObjects, __RelatedObjectsType, __RelatingGroup)
 {
     this._Factor = __Factor;
 }
 public IfcAlignment2DVerSegParabolicArc(IfcBoolean?__TangentialContinuity, IfcLabel?__StartTag, IfcLabel?__EndTag, IfcLengthMeasure __StartDistAlong, IfcPositiveLengthMeasure __HorizontalLength, IfcLengthMeasure __StartHeight, IfcRatioMeasure __StartGradient, IfcPositiveLengthMeasure __ParabolaConstant, IfcBoolean __IsConvex)
     : base(__TangentialContinuity, __StartTag, __EndTag, __StartDistAlong, __HorizontalLength, __StartHeight, __StartGradient)
 {
     this._ParabolaConstant = __ParabolaConstant;
     this._IsConvex         = __IsConvex;
 }
Example #10
0
 public IfcAlignment2DVerSegLine(IfcBoolean?__TangentialContinuity, IfcLabel?__StartTag, IfcLabel?__EndTag, IfcLengthMeasure __StartDistAlong, IfcPositiveLengthMeasure __HorizontalLength, IfcLengthMeasure __StartHeight, IfcRatioMeasure __StartGradient)
     : base(__TangentialContinuity, __StartTag, __EndTag, __StartDistAlong, __HorizontalLength, __StartHeight, __StartGradient)
 {
 }