public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height) : base(container, new IfcLocalPlacement(container.Placement, placement), null) { DatabaseIfc db = mDatabase; double tol = mDatabase.Tolerance; setMaterial(layerSetUsage); IfcShapeRepresentation asr = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db, 0, 0, 0), new IfcCartesianPoint(db, length, 0, 0))); List <IfcShapeModel> reps = new List <IfcShapeModel>(); reps.Add(asr); double t = layerSetUsage.ForLayerSet.MaterialLayers.ToList().ConvertAll(x => x.LayerThickness).Sum(); reps.Add(new IfcShapeRepresentation(new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db, "", length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db, length / 2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t / 2.0, 0)), height))); Representation = new IfcProductDefinitionShape(reps); }
internal IfcMaterialLayerSet detectMaterialLayerSet() { IfcRelAssociatesMaterial associates = RelatedMaterialAssociation; if (associates == null) { return(null); } IfcMaterialSelect material = associates.RelatingMaterial; IfcMaterialLayerSet materialLayerSet = material as IfcMaterialLayerSet; if (materialLayerSet != null) { return(materialLayerSet); } IfcMaterialLayerSetUsage materialLayerSetUsage = material as IfcMaterialLayerSetUsage; if (materialLayerSetUsage != null) { return(materialLayerSetUsage.ForLayerSet); } return(null); }
public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height) : base(container,new IfcLocalPlacement(container.Placement, placement),null) { DatabaseIfc db = mDatabase; double tol = mDatabase.Tolerance; setMaterial(layerSetUsage); IfcShapeRepresentation asr = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db,0,0,0),new IfcCartesianPoint(db,length,0,0))); List<IfcShapeModel> reps = new List<IfcShapeModel>(); reps.Add(asr); double t = layerSetUsage.ForLayerSet.MaterialLayers.ConvertAll(x=>x.LayerThickness).Sum(); reps.Add(new IfcShapeRepresentation( new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db,"",length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db,length/2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t/2.0, 0)), height))); Representation = new IfcProductDefinitionShape(reps); }
internal static void parseFields(IfcMaterialLayerSetUsage m, List<string> arrFields, ref int ipos,Schema schema) { IfcMaterialUsageDefinition.parseFields(m, arrFields, ref ipos); m.mForLayerSet = ParserSTEP.ParseLink(arrFields[ipos++]); m.mLayerSetDirection = (IfcLayerSetDirectionEnum)Enum.Parse(typeof(IfcLayerSetDirectionEnum), arrFields[ipos++].Replace(".", "")); m.mDirectionSense = (IfcDirectionSenseEnum)Enum.Parse(typeof(IfcDirectionSenseEnum), arrFields[ipos++].Replace(".", "")); m.mOffsetFromReferenceLine = ParserSTEP.ParseDouble(arrFields[ipos++]); try { if (schema != Schema.IFC2x3 && ipos + 1 < arrFields.Count) m.mReferenceExtent = ParserSTEP.ParseDouble(arrFields[ipos++]); } catch (Exception) { } }
internal static IfcMaterialLayerSetUsage Parse(string strDef,Schema schema) { IfcMaterialLayerSetUsage u = new IfcMaterialLayerSetUsage(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return u; }
internal IfcMaterialLayerSetUsage(IfcMaterialLayerSetUsage m) : base(m) { mForLayerSet = m.mForLayerSet; mLayerSetDirection = m.mLayerSetDirection; mDirectionSense = m.mDirectionSense; mOffsetFromReferenceLine = m.mOffsetFromReferenceLine; mReferenceExtent = m.mReferenceExtent; }
public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, IfcProductDefinitionShape shape) : base(container, new IfcLocalPlacement(container.Placement, placement), null) { setMaterial(layerSetUsage); Representation = shape; }