internal static IfcFootingType generate(DatabaseIfc db, bool parametric, double length, double width, double height) { string name = parametric ? "PadFootingParametric" : "PadFooting" + length + "x" + width + "x" + height; IfcFootingType footingType = new IfcFootingType(db, name, IfcFootingTypeEnum.PAD_FOOTING); IfcRectangleProfileDef rpd = new IfcRectangleProfileDef(db, name, length, width); footingType.RepresentationMaps = new List <IfcRepresentationMap>() { new IfcRepresentationMap(new IfcExtrudedAreaSolid(rpd, new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, -height)), new IfcDirection(db, 0, 0, 1), height)) }; Qto_FootingBaseQuantities baseQuantities = new Qto_FootingBaseQuantities(footingType); baseQuantities.Length = length; baseQuantities.Width = width; baseQuantities.Height = height; List <IfcPhysicalQuantity> quantities = baseQuantities.Quantities; if (parametric) { string prefix = @"RepresentationMaps[1].MappedRepresentation.Items[1]\IfcExtrudedAreaSolid."; CreateConstraint("Length", footingType, quantities[0], prefix + @"SweptArea\IfcRectangleProfileDef.XDim"); CreateConstraint("Width", footingType, quantities[1], prefix + @"SweptArea\IfcRectangleProfileDef.YDim"); CreateConstraint("Height", footingType, quantities[2], prefix + @"Depth"); IfcAppliedValue appv = new IfcAppliedValue(new IfcAppliedValue(IfcReference.ParseDescription(db, "HasPropertySets['" + baseQuantities.Name + "'].HasProperties['" + quantities[2].Name + "']")), IfcArithmeticOperatorEnum.MULTIPLY, new IfcAppliedValue(db, new IfcReal(-1))); CreateConstraint("Offset", footingType, appv, @"Position.Location.CoordinateZ"); } return(footingType); }
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: _RelatingAppliedValue = (IfcAppliedValue)value.EntityVal; break; default: this.HandleUnexpectedAttribute(propIndex, value); break; } }
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: _relatingAppliedValue = (IfcAppliedValue)(value.EntityVal); 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()); }
public IfcRelAssociatesAppliedValue(IfcGloballyUniqueId __GlobalId, IfcOwnerHistory __OwnerHistory, IfcLabel?__Name, IfcText?__Description, IfcRoot[] __RelatedObjects, IfcAppliedValue __RelatingAppliedValue) : base(__GlobalId, __OwnerHistory, __Name, __Description, __RelatedObjects) { this._RelatingAppliedValue = __RelatingAppliedValue; }